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 does not comply with RFC2616 #448

Closed
Paradyx opened this issue Aug 5, 2018 · 6 comments
Closed

Host header does not comply with RFC2616 #448

Paradyx opened this issue Aug 5, 2018 · 6 comments

Comments

@Paradyx
Copy link

Paradyx commented Aug 5, 2018

Sending a request to a host on a port other then 80 should change the host header according to RFC2616 14.23 Host
i.e.: Connecting to localhost:8081 should write the header host: localhost:8081 and not host: localhost

@DoumanAsh
Copy link
Contributor

Isn't port optional though?

@Paradyx
Copy link
Author

Paradyx commented Aug 5, 2018

RFC states

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

And I have a server here which rejects my request when not setting the host header correctly.

@DoumanAsh
Copy link
Contributor

DoumanAsh commented Aug 6, 2018

Ah, I understand the implication, but what I say is that it is not MUST to specify port :)

So you would like default host to be set according to remote domain name and port, used for connection
automatically?
It is quite rare to run server on non-80 port, but I guess we could do it.

Just for your interest, HOST is set, if it is omitted, here https://github.com/actix/actix-web/blob/master/src/client/request.rs#L629-L640

@Paradyx
Copy link
Author

Paradyx commented Aug 6, 2018

That would be great 👍

@DoumanAsh
Copy link
Contributor

@Paradyx If you have time, you could do it youself, PRs are welcome 😄

I'll take a look at it later one, after work

@DoumanAsh
Copy link
Contributor

@Paradyx Btw should we omit port in header when we use default HTTPs port too? 😄

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