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

"Host" header set incorectly (port missing) #63

Closed
d4h0 opened this issue Jun 12, 2020 · 2 comments
Closed

"Host" header set incorectly (port missing) #63

d4h0 opened this issue Jun 12, 2020 · 2 comments

Comments

@d4h0
Copy link

d4h0 commented Jun 12, 2020

It seems if an URL with a port is used – for example, "http://localhost:9222/json/version" – then the "Host" header is not set correctly (the port seems to be missing).

I connected to the HTTP front end of a DevTools protocol server, which returns a WebSocket URL.

When I connected via ureq this WebSocket URL did not include the port of the server (and connecting to the WebSocket URL failed, therefore).

When I inspected the response of the server with different clients (Chrome and Curl), the server returned the correct WebSocket URL.

After I added the correct "Host" header to the ureq request myself, the server returned the correct WebSocket URL as well.

Therefore I assume that ureq does not set the "Host" header correctly.

According to MDN, if no port is included in the "Host" header, it defaults to 80 (for HTTP) or 443 (for HTTPS), which in the above case is incorrect.

@algesten
Copy link
Owner

@d4h0 you're very right. i fixed it and added a test for it. sorted in 1.1.2

@d4h0
Copy link
Author

d4h0 commented Jun 13, 2020

@algesten: Awesome, thank you!

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

No branches or pull requests

2 participants