Skip to content

Don't replace all connection headers when sending h2c upgrade request#7824

Merged
normanmaurer merged 1 commit into
netty:4.1from
bryce-anderson:dontStripConnectionHeaders
Apr 1, 2018
Merged

Don't replace all connection headers when sending h2c upgrade request#7824
normanmaurer merged 1 commit into
netty:4.1from
bryce-anderson:dontStripConnectionHeaders

Conversation

@bryce-anderson
Copy link
Copy Markdown
Contributor

@bryce-anderson bryce-anderson commented Mar 30, 2018

Motivation:

There may be meaningful 'connection' headers that exist on a request
that is used to attempt a HTTP/1.x upgrade request that will be
clobbered.

Modifications:

HttpClientUpgradeHandler uses the HttpHeaders.add instead of
HttpHeaders.set when adding the 'upgrade' field.

Result:

Fixes #7823
Existing 'connection' headers are preserved.

Copy link
Copy Markdown
Member

@normanmaurer normanmaurer left a comment

Choose a reason for hiding this comment

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

Please address comments

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.

You need to release this one

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.

Also call channel.finish() and assert the return value

Motivation:

There may be meaningful 'connection' headers that exist on a request
that is used to attempt a HTTP/1.x upgrade request that will be
clobbered.

Modifications:

HttpClientUpgradeHandler uses the `HttpHeaders.add` instead of
`HttpHeaders.set` when adding the 'upgrade' field.

Result:

Fixes netty#7823
Existing 'connection' headers are preserved.
@bryce-anderson bryce-anderson force-pushed the dontStripConnectionHeaders branch from 715c16b to d599734 Compare March 30, 2018 21:16
@bryce-anderson
Copy link
Copy Markdown
Contributor Author

@normanmaurer, done. One of these days my tests cases will release everything the first time. 😄

@normanmaurer
Copy link
Copy Markdown
Member

@normanmaurer
Copy link
Copy Markdown
Member

normanmaurer commented Apr 1, 2018

I rechecked the RFC (and other implementations) and its definitely allowed to have multiple connection header values (even when upgrade).

@normanmaurer normanmaurer added this to the 4.1.23.Final milestone Apr 1, 2018
@normanmaurer normanmaurer merged commit 7416020 into netty:4.1 Apr 1, 2018
@bryce-anderson
Copy link
Copy Markdown
Contributor Author

Thanks for double checking @normanmaurer, and thanks again for the review.

@bryce-anderson bryce-anderson deleted the dontStripConnectionHeaders branch April 2, 2018 14:22
Copy link
Copy Markdown
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants