Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Port number is dropped from Location: header as parsed by client #16

Closed
kmcallister opened this issue Sep 23, 2013 · 2 comments · Fixed by rust-lang/rust#9927
Closed

Comments

@kmcallister
Copy link
Contributor

Steps to reproduce:

$ printf 'HTTP/1.0 301 Moved Permanently\r\nLocation: http://localhost:8080/foo\r\n\r\n' | nc -l -p 8080 &
$ RUST_LOG=net::http_loader ./servo http://127.0.0.1:8080

Servo sees a header.header_value() of http://localhost/foo which is not what the server sent.

@kmcallister
Copy link
Contributor Author

I can also reproduce this with the included example client.

$ printf 'HTTP/1.0 301 Moved Permanently\r\nLocation: http://localhost:8080/foo\r\n\r\n' | nc -l -p 8001 &
$ ./build/examples/client/client 
Yay! Started to get the response.
Status: 301 Moved Permanently
Headers:
 - Location: http://localhost/foo

Response:

@chris-morgan
Copy link
Owner

That header is handled with extra::url::Url's FromStr and ToStr implementations.

extra::url::to_str doesn't do anything with the port. This is defective behaviour!

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

Successfully merging a pull request may close this issue.

2 participants