-
Notifications
You must be signed in to change notification settings - Fork 918
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
Send the correct 'Host' header when upgrading. #100
Merged
Merged
Conversation
This file contains 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
trustin
force-pushed
the
fix_h2c_upgrade_request
branch
3 times, most recently
from
January 28, 2016 09:50
7cde51a
to
f05ffff
Compare
@anuraaga PTAL |
} | ||
|
||
final StringBuilder buf = new StringBuilder(host.length() + 6); | ||
buf.append(host); |
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.
Chain methods
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.
Fixed
Just one nit |
trustin
force-pushed
the
fix_h2c_upgrade_request
branch
from
January 29, 2016 07:02
f05ffff
to
712add3
Compare
Related: line#98 Motivation: HttpSessionChannelFactory keeps the cached map from SessionProtocol to Bootstrap. The cached Bootstrap configures its new Channels to send the name of the target host with an H1C-to-H2C upgrade request. Unfortunately, The cached Bootstrap does not determine the target host name dynamically but just uses the initially specified one, and this makes a client send a wrong 'Host' header when a pool creates a new connection with a different target host name and with the same SessionProtocol. Modifications: - HttpConfigurator doesn't require a 'host' parameter anymore. It retrieves the target host name by intercepting the 'connect()' operation. - Add HttpHostHeaderUtil that creates 'Host' header value correctly - Use HttpHostHeaderUtil.hostHeader() in HttpConfigurator and HttpSessionHandler to reduce code duplication - Miscellaneous: - Replace HttpRemoteInvoker.poolKey() with direct constructor call - Fix the API documentation of ServiceInvocationContext.host() - Reorganize the methods and inner classes in HttpConfigurator - Remove ByteBufOverHttpCodec which is not used anymore Result: - Armeria client sends the correct 'Host' header when it sends a upgrade request. - Description of ServiceInvocationContext.host() is not misleading anymore.
@anuraaga Addressed the nit |
anuraaga
added a commit
that referenced
this pull request
Feb 2, 2016
Send the correct 'Host' header when upgrading.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related: #98
Motivation:
HttpSessionChannelFactory keeps the cached map from SessionProtocol to
Bootstrap. The cached Bootstrap configures its new Channels to send the
name of the target host with an H1C-to-H2C upgrade request.
Unfortunately, The cached Bootstrap does not determine the target host
name dynamically but just uses the initially specified one, and this
makes a client send a wrong 'Host' header when a pool creates a new
connection with a different target host name and with the same
SessionProtocol.
Modifications:
retrieves the target host name by intercepting the 'connect()'
operation.
HttpSessionHandler to reduce code duplication
Result:
request.
anymore.