-
Notifications
You must be signed in to change notification settings - Fork 30.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
http2: Fix "ERR_HTTP2_INVALID_CONNECTION_HEADERS" error when adding "connection' into header #23908
Conversation
ec4bdb1
to
6f9c3f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would change the behavior for non-compat mode also, which is not ideal. The check should be done in compat.js
rather than in util.js
Ok. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unfortunately not the right approach. I've left some comments.
What about this PR, it is waiting for approval long time. |
Hi @sagitsofan , I was just a passer by, similar to you and just had a comment; I don't have the ability to move this further along and eventually merge, sorry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@jasnell @apapirovski can you check again?
@sagitsofan can you please update the title/description on the PR to something more related the actual change? |
connection
header
connection
headerconnection
header
connection
headerconnection
into header
connection
into header9417763
to
3852abc
Compare
@mcollina i updated the title and description and fix the conflicts |
@jasnell @apapirovski Can you please review? |
@jasnell ? |
Can you please add a unit test? |
Ignoring the connection header and disable the `ERR_HTTP2_INVALID_CONNECTION_HEADERS` error. Added a warning log on the compatibility. Fixes: nodejs#23748
967d805
to
56f165c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test should verify if the warning is emitted.
@mcollina, I have verified that the warning is emitted and also i am making sure that adding the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@jasnell Pinging again :-) |
Thanx. |
if (name !== constants.HTTP2_HEADER_CONNECTION) | ||
return true; | ||
else | ||
return value === 'trailers'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this could be simplified to:
return name !== constants.HTTP2_HEADER_CONNECTION ||
value === 'trailers';
Landed in 8c597df 🎉 I took the liberty to improve the commit message and addressed my nit while landing. |
When using the compatibility API the connection header is from now on ignored instead of throwing an `ERR_HTTP2_INVALID_CONNECTION_HEADERS` error. This logs a warning in such case to notify the user about the ignored header. PR-URL: nodejs#23908 Fixes: nodejs#23748 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
When using the compatibility API the connection header is from now on ignored instead of throwing an `ERR_HTTP2_INVALID_CONNECTION_HEADERS` error. This logs a warning in such case to notify the user about the ignored header. PR-URL: #23908 Fixes: #23748 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
When using the compatibility API the connection header is from now on ignored instead of throwing an `ERR_HTTP2_INVALID_CONNECTION_HEADERS` error. This logs a warning in such case to notify the user about the ignored header. PR-URL: #23908 Fixes: #23748 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
When using the compatibility API the connection header is from now on ignored instead of throwing an `ERR_HTTP2_INVALID_CONNECTION_HEADERS` error. This logs a warning in such case to notify the user about the ignored header. PR-URL: #23908 Fixes: #23748 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
lib: http2 compatibility connection header
When adding the
connection
header intohttp2 response, an
ERR_HTTP2_INVALID_CONNECTION_HEADERS
error is thrown.
This PR is ignoring the connection header and disable the
ERR_HTTP2_INVALID_CONNECTION_HEADERS
error.A new warning log is emitted on the compatibility.
Fixes: #23748
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes