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

Incorrect Host header used on redirected requests #693

Open
sykesm opened this issue Oct 20, 2021 · 2 comments
Open

Incorrect Host header used on redirected requests #693

sykesm opened this issue Oct 20, 2021 · 2 comments
Labels

Comments

@sykesm
Copy link

sykesm commented Oct 20, 2021

When a request is made to a server running on a non-standard port, the port should be included in the Host header. This is part of RFC-2616.

When follow_redirect is enabled and the client gets a 302 redirect, hackney's request to the new target includes a Host header for the new host but it does not include the port. When used with strict servers, this results in a bad request response.

@benoitc benoitc added the http label Mar 14, 2022
@benoitc
Copy link
Owner

benoitc commented Mar 14, 2022

mmm are you sure of this? The rfc says

A "host" without any trailing port information implies the default port for the service requested

Was the port different from 80 or 443? I will write a test for it anyway.

@sykesm
Copy link
Author

sykesm commented Mar 14, 2022

Was the port different from 80 or 443? I will write a test for it anyway.

Yes, that's what I meant by "non-standard port."

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

No branches or pull requests

2 participants