在不刷新客户端的情况下无法两次请求 Iron Router 服务器路由

Cannot request Iron Router server route twice without refreshing the client

我正在调用流星方法,它使用 fs. I wait for a callback giving me the path where the file exists, and then I request the file with a server route. The code is very similar to this SO answer. I have also tried using createReadStream (as demonstrated here) 生成文件,而不是将文件直接传递给 response.write

这一切在客户第一次点击我的 export/download 按钮时运行良好。但是,如果出于某种原因他们想多次单击该按钮,则会生成文件,但 Iron Router 不会提供该文件。客户端或服务器上没有错误。如果用户刷新客户端,该功能将再次工作(一次)。

为什么我需要刷新浏览器才能第二次请求相同的服务器路由?我做错了吗?


Example Application

当他们点击第一次下载时 URL 会改变吗?如果是这样,并且第二条路线相同,您将不会被重定向,因为您已经在那里。如果是这种情况,您可以使用路由器挂钩将用户发送回他们来自的路由吗?