-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
UnhandledPromiseRejection: Improper headers on http2 response #3830
Comments
There are some bits of hapi internals that are not guarded against promise rejections. Mostly, this is not a problem due to the extensive test suite, but occasionally something like this can slip through. Normally, hapi works similar to what you expect, however you have run into a corner case, where an already errorred transmission, causes another error in the attempt to send the error response. |
The fact that adding a |
Is this an issue or is this just accepted behaviour?
I agree, I think the fact that adding a connection header causes the response (I assume) to fail breaks the compatibility API. I assume there is a reason they fail rather than just ignoring it though. Either way I suppose this is something that should be brought upstream but for the time being I feel the changes I purposed should be implemented, hopefully as a short term patch. If the node team does decide that this is intended behaviour then it just becomes a permanent patch. However before I open an issue upstream, the compatibility API states:
Do you know if the connection header falls under internal methods or state? |
Definitely not. It's just an argument for the very public |
It seems that a node core fix is on its way for your actual issue: nodejs/node#23908. Even when fixed, this still leaves hapi with potential |
Replaced by #3974 |
Are you sure this is an issue with the hapi core module or are you just looking for some help?
Issue with hapi core.
Is this a security related issue?
No.
What are you trying to achieve or the steps to reproduce?
Make a http2 request that triggers the following:
What was the result you received?
No response to request.
What did you expect?
A response of some kind, if this error was handled, an error response.
Context
Fix
From MDN:
Replace:
hapi/lib/transmit.js
Lines 96 to 101 in 7ffd301
With:
Afterthoughts
Should this even be allowed to happen? This would suggest that somewhere along the response chain a possible error is not accounted for. What should have really happened is an internal error response to the client and an error message to the console stating:
TypeError [ERR_HTTP2_INVALID_CONNECTION_HEADERS]: HTTP/1 Connection specific headers are forbidden: "connection"
.The text was updated successfully, but these errors were encountered: