FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

http2: Fix "ERR_HTTP2_INVALID_CONNECTION_HEADERS" error when adding "connection' into header by sagitsofan · Pull Request #23908 · nodejs/node · GitHub

/ node Public

http2: Fix "ERR_HTTP2_INVALID_CONNECTION_HEADERS" error when adding "connection' into header - #23908

Closed
sagitsofan wants to merge 22 commits into
nodejs:masterfrom
sagitsofan:http_compat
Closed

http2: Fix "ERR_HTTP2_INVALID_CONNECTION_HEADERS" error when adding "connection' into header#23908
sagitsofan wants to merge 22 commits into
nodejs:masterfrom
sagitsofan:http_compat

Conversation

sagitsofan commented Oct 26, 2018
edited
Loading

Copy link
Copy Markdown
Contributor

lib: http2 compatibility connection header

When adding the connection header into
http2 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), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

nodejs-github-bot added dont-land-on-v6.x http2 Issues or PRs related to the http2 subsystem. labels Oct 26, 2018

jasnell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Comment thread lib/internal/http2/util.js Outdated

sagitsofan commented Oct 27, 2018
edited
Loading

Copy link
Copy Markdown
Contributor Author

Ok.
I will move it into the compatibility API, and update this PR.

apapirovski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is unfortunately not the right approach. I've left some comments.

Comment thread lib/internal/http2/compat.js Outdated
Comment thread lib/internal/http2/compat.js Outdated
Comment thread lib/internal/http2/compat.js Outdated
Comment thread lib/internal/http2/compat.js Outdated
Comment thread lib/internal/http2/compat.js Outdated

Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Contributor Author

What about this PR, it is waiting for approval long time.

Copy link
Copy Markdown
Member

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 previously approved these changes Dec 3, 2018

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

@jasnell @apapirovski can you check again?

mcollina commented Dec 3, 2018

Copy link
Copy Markdown
Member

@sagitsofan can you please update the title/description on the PR to something more related the actual change?

mcollina commented Dec 3, 2018

Copy link
Copy Markdown
Member

sagitsofan changed the title Http compat Lib: Http2, Fix "ERR_HTTP2_INVALID_CONNECTION_HEADERS" when adding connection header Dec 3, 2018
sagitsofan changed the title Lib: Http2, Fix "ERR_HTTP2_INVALID_CONNECTION_HEADERS" when adding connection header http2: Fix "ERR_HTTP2_INVALID_CONNECTION_HEADERS" when adding connection header Dec 3, 2018
sagitsofan changed the title http2: Fix "ERR_HTTP2_INVALID_CONNECTION_HEADERS" when adding connection header http2: Fix "ERR_HTTP2_INVALID_CONNECTION_HEADERS" error when adding connection into header Dec 3, 2018
sagitsofan changed the title http2: Fix "ERR_HTTP2_INVALID_CONNECTION_HEADERS" error when adding connection into header http2: Fix "ERR_HTTP2_INVALID_CONNECTION_HEADERS" error when adding "connection' into header Dec 3, 2018

sagitsofan commented Dec 4, 2018
edited
Loading

Copy link
Copy Markdown
Contributor Author

@mcollina i updated the title and description and fix the conflicts

Copy link
Copy Markdown
Contributor Author

@jasnell @apapirovski Can you please review?

Copy link
Copy Markdown
Contributor Author

@jasnell ?

Copy link
Copy Markdown
Member

Can you please add a unit test?

mcollina dismissed their stale review December 11, 2018 13:37

a unit test is needed

Ignoring the connection header and disable the
`ERR_HTTP2_INVALID_CONNECTION_HEADERS` error.

Added a warning log on the compatibility.

Fixes: nodejs#23748

Copy link
Copy Markdown
Contributor Author

@jasnell @mcollina Added test, please review.

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The test should verify if the warning is emitted.

sagitsofan commented Dec 15, 2018
edited
Loading

Copy link
Copy Markdown
Contributor Author

@mcollina, I have verified that the warning is emitted and also i am making sure that adding the connection into the header is not throwing any exception.

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

Copy link
Copy Markdown
Contributor Author

@jasnell Pinging again :-)

Copy link
Copy Markdown
Contributor Author

Thanx.
Who is landing this PR?

if (name !== constants.HTTP2_HEADER_CONNECTION)
return true;
else
return value === 'trailers';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: this could be simplified to:

return name !== constants.HTTP2_HEADER_CONNECTION ||
       value === 'trailers';

Copy link
Copy Markdown
Member

BridgeAR added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Jan 3, 2019

BridgeAR commented Mar 4, 2019

Copy link
Copy Markdown
Member

Landed in 8c597df 🎉

I took the liberty to improve the commit message and addressed my nit while landing.

BridgeAR closed this Mar 4, 2019
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Mar 4, 2019
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>
BridgeAR pushed a commit that referenced this pull request Mar 4, 2019
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>
BridgeAR mentioned this pull request Mar 4, 2019
BridgeAR pushed a commit that referenced this pull request Mar 5, 2019
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>
BethGriggs pushed a commit that referenced this pull request Apr 16, 2019
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>
BethGriggs mentioned this pull request May 1, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. http2 Issues or PRs related to the http2 subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http2/http1 compatibility API error with connection header

7 participants


Back | FazBrowse Home | New Git URL