Skip to content
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

Set the HOST header in Http2ClientInitializer when trying to start an… #9177

Merged
merged 1 commit into from
May 27, 2019

Conversation

normanmaurer
Copy link
Member

… upgrade request

Motivation:

The io.netty.example.http2.helloworld.client.Http2Client example should work in the h2c (HTTP2 cleartext - non-TLS) mode, which is the default for this example unless you set a -Dssl VM param. As we do not set the HOST header some servers do reject the upgrade request.

Modifications:

Set the HOST header

Result:

Fixes #9115.

… upgrade request

Motivation:

The io.netty.example.http2.helloworld.client.Http2Client example should work in the h2c (HTTP2 cleartext - non-TLS) mode, which is the default for this example unless you set a -Dssl VM param. As we do not set the HOST header some servers do reject the upgrade request.

Modifications:

Set the HOST header

Result:

Fixes #9115.
@normanmaurer
Copy link
Member Author

I was first thinking if we should put the logic in HttpClientUpgradeHandler but then decided it may be just ok to do it directly in the example... WDYT ?

@normanmaurer normanmaurer added this to the 4.1.37.Final milestone May 23, 2019
@normanmaurer
Copy link
Member Author

@netty-bot test this please

Copy link
Member

@carl-mastrangelo carl-mastrangelo left a comment

Choose a reason for hiding this comment

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

LGTM

@normanmaurer normanmaurer merged commit 8b04c5f into 4.1 May 27, 2019
@normanmaurer normanmaurer deleted the http2_client_host branch May 27, 2019 14:02
normanmaurer added a commit that referenced this pull request May 27, 2019
… upgrade request (#9177)

Motivation:

The io.netty.example.http2.helloworld.client.Http2Client example should work in the h2c (HTTP2 cleartext - non-TLS) mode, which is the default for this example unless you set a -Dssl VM param. As we do not set the HOST header some servers do reject the upgrade request.

Modifications:

Set the HOST header

Result:

Fixes #9115.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Http2ClientUpgradeCodec makes invalid HTTP1 request (hence http2.helloworld.client example fails for h2c mode)
2 participants