-
Notifications
You must be signed in to change notification settings - Fork 971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sending after request end doesn't throw error, hangs response instead #766
Comments
Thank you, I can reproduce that behavior. It seems specific to there being no body to your first |
@dougwilson Thank you for the quick response on this and for investigating! From what I can observe, yes, I can confirm your statement is true. For more of a concrete insight on how this might manifest (as I agree, it's rather specific), this confusion surfaced when I ran into this while integrating PassportJS—I set up |
Hi @josh-byster , sorry if my response was confusing: I'm not trying to say this is not a bug, I just wanted to make sure that the simple fix would actually result in the behavior you're looking for by having you confirm if that behavior is what you're looking for. Then we would fix the specific case that is not resulting in said behavior to make sure your case is working. |
Completely understandable, and thank you for the clarification :) I just wanted to give an example of a concrete use case in addition, as I realized my original issue report lacked a concrete way for which this behavior may surface. |
Hi @josh-byster there is a PR #767 that should fix it if you are interested in giving it a test. |
Hi, I've noticed that when including
express-session
, theres.end
behavior (from what I'm assuming is due to the proxied res.end) deviates from what I would expect in handling errors.Generally if I were to call
res.end
and then later inadvertently callres.send
after that (perhaps in another middleware handler), I would receive anERR_HTTP_HEADERS_SENT
. That's what I was expecting to see—however, instead, if I include the session middleware, the headers send but it waits for 5s (which I think is the default keepAlive timeout) until erroring out with a content length mismatch (since it is settingContent-Length
but the body doesn't go through). In my opinion, it would be helpful to have that original error bubble through if possible, since it was not clear that including this middleware would cause this API change tores.end
as a side effect.The text was updated successfully, but these errors were encountered: