res.sendFile does not invoke callback for aborted requests.#2305
res.sendFile does not invoke callback for aborted requests.#2305manuelstofer wants to merge 15 commits intoexpressjs:masterfrom
Conversation
Change repository reference
Revert the change that breaks a test case
Strongloop’s ownership of the code is causing him legal troubles. Fixes expressjs#2279
new qs module packaged to npm, rev to version 1.0.0
|
It's debatable if aborts are errors. The current documentation is:
Not invoking the callback at all would actually be correct if aborts are not counted as errors. But it's unexpected behaviour. I agree that an abort is not necessarily an error on http request level (for requests without body). But i think it is an error in sendFiles context, because it prevents it from "completing the transfer". So I'm not sure if i should pass an error to the callback if the request is aborted. |
|
But anyway, the purpose of this pull request is not to change the thing about the aborts, so i removed the abort errors. This pull request just ensures that the callback is always invoked. |
|
@dougwilson |
Oh, so the repo was not correctly up to date for a while (it was my fault :( ). That was it getting back in sync.
Up to you, but it's not necessary. |
|
@manuelstofer can you try out the 4.9 branch to see if your issue has been resolved? |
|
Works great! |
|
Awesome, thanks for the confirmation, @manuelstofer , I appreciate it! |
I added two currently failing tests for cases where sendFile fails to invoke the callback.