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

Zones in link-local IPv6 addresses seems to be not supported. #322

Closed
vi opened this issue Jun 11, 2019 · 4 comments · Fixed by #343
Closed

Zones in link-local IPv6 addresses seems to be not supported. #322

vi opened this issue Jun 11, 2019 · 4 comments · Fixed by #343

Comments

@vi
Copy link

vi commented Jun 11, 2019

extern crate http;

fn main() {
    use http::uri::Uri;
    use std::str::FromStr;
    Uri::from_str("http://[fe80::1%25eth0]:8080/").unwrap();
}

InvalidUri(InvalidAuthority).

It parses if I omit the zone index (%25eth0), but such URI is expected to be unconnectable by itself.

Should http crate support RFC6874 and allow link-local IPv6 in URLs?

@olix0r
Copy link

olix0r commented Jun 13, 2019

For what it's worth, SocketAddr::parse does not handle this address either: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ac423a008035b1e29562123d416fa551

@vi
Copy link
Author

vi commented Jun 14, 2019

Yet there is scope_id in SockAddrV6, an u32 field.

Filling it in from parse requires querying network interfaces information in a platform-specific way although.

P.S. For SocketAddr::parse it shouldn't be URL-encoded: [fe80::1%eth0]:80.

@raggi
Copy link

raggi commented Aug 23, 2019

If we prepared a patch to introduce this feature would it be accepted?

@carllerche
Copy link
Collaborator

If it is valid in the http spec and doesn’t break anything (both which sound correct) then yes!

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

Successfully merging a pull request may close this issue.

4 participants