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

Netty: Don't set Host header port when it's the scheme's default one #899

Closed
yatindra opened this issue Jun 1, 2015 · 7 comments
Closed
Assignees
Milestone

Comments

@yatindra
Copy link

yatindra commented Jun 1, 2015

Hi,

So, this is actually not an issue, but I would like to know a workaround for this.
When the Host header in request contains the port as well Host: www.example.com:443
which is the default behaviour and which is also as per RFC, servers like IIS fail to parse it properly and return a 404 for a valid URL.
This may not be the case always, only when IIS is not configured properly.
For direct cases where I know the end URL, I usually set the Host header manually and AHC does not overwrite the value I provide.
But in cases where a redirection happens AHC will generate a new request and there I don't have control over the value. I don't have control over the original URL input as well, so updating to the correct URL is also not possible.
Example URL: https://www.chamberofcommerce.com/short-hills-nj/11218079-massage-envy-spa-short-hills-llc

Is there a workaround for this?

@slandelle
Copy link
Contributor

A proper solution would be to not pass the port when it's the scheme's default one.
Fixing.

@slandelle slandelle added this to the 1.9.26 milestone Jun 1, 2015
@slandelle slandelle self-assigned this Jun 1, 2015
@slandelle
Copy link
Contributor

As a workaround, you can explicitly set the Host header in the request.

@slandelle
Copy link
Contributor

@yatindra Fixed, thanks for reporting!
Do you have more issues to report?

@slandelle slandelle changed the title Netty: Workaround for IIS server when Host header value contains port as well Netty: Don't set Host header port when it's the scheme's default one Jun 1, 2015
@yatindra
Copy link
Author

yatindra commented Jun 1, 2015

Thanks a lot.
I don't have any issues/bugs.
But I have one feature requests regarding redirection.
Will it be possible to get the final set of cookies that were propagated in the response received at AsyncHandler?

@yatindra
Copy link
Author

yatindra commented Jun 1, 2015

By the way when would you be releasing 1.9.26?

@slandelle
Copy link
Contributor

Will it be possible to get the final set of cookies that were propagated in the response received at AsyncHandler?

Implement AsyncHandlerExtensions and inspect onSendRequest parameter.

By the way when would you be releasing 1.9.26?

Just did. Wait for sync to happen on central.

@yatindra
Copy link
Author

yatindra commented Jun 1, 2015

Great thanks.

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

No branches or pull requests

2 participants