http2: Fix "ERR_HTTP2_INVALID_CONNECTION_HEADERS" error when adding "connection' into header#23908
http2: Fix "ERR_HTTP2_INVALID_CONNECTION_HEADERS" error when adding "connection' into header#23908sagitsofan wants to merge 22 commits intonodejs:masterfrom
Conversation
ec4bdb1 to
6f9c3f6
Compare
jasnell
left a comment
There was a problem hiding this comment.
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. |
apapirovski
left a comment
There was a problem hiding this comment.
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. |
mcollina
left a comment
There was a problem hiding this comment.
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
mcollina
left a comment
There was a problem hiding this comment.
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 |
|
@jasnell Pinging again :-) |
|
Thanx. |
| if (name !== constants.HTTP2_HEADER_CONNECTION) | ||
| return true; | ||
| else | ||
| return value === 'trailers'; |
There was a problem hiding this comment.
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 <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
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 <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
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 <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
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 <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
lib: http2 compatibility connection header
When adding the
connectionheader intohttp2 response, an
ERR_HTTP2_INVALID_CONNECTION_HEADERSerror is thrown.
This PR is ignoring the connection header and disable the
ERR_HTTP2_INVALID_CONNECTION_HEADERSerror.A new warning log is emitted on the compatibility.
Fixes: #23748
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes