-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 output incorrect when explicitly specifying the default port #1034
Comments
Thanks for the report, @thetuxkeeper! The reported vs. actual The default protocol port normalization is quite common. But we should document it together with the possible explicit Relevant spec:
|
@jakubroztocil : Thanks for the fast response! Yes, the removal of the default port is usually expected. Just the inconsistency bug was irritating. |
A simple fix can be applied, I think. to UPDATE: It breaks on IPv6. I haven't checked that out yet.
|
Hi,
if you do something like
http --print hH http://localhost:80/
you get this with:80
in the host header as output:But if you look at it with strace (
strace -f -v -s 256 -e sendto http --print hH http://localhost:80/
) you getSo the port was removed in the actual request.
What httpie is showing is wrong in this case. It works with non-default ports, so it's just an issue with http + 80 and https + 443.
It confused me when I debugged a custom host header matching logic where I forgot to match/ignore the port.
It should both match, so there's no confusion what really is sent.
Workaround:
If you want to get the port to the host header, you have to use the header request item argument.
The text was updated successfully, but these errors were encountered: