Open
Description
It seems the URI parser stumbles with URNs. A simple test to reproduce:
fn main() {
use http::uri::Uri;
let uri = "urn:isbn:1238492".parse::<Uri>();
println!("{:?}", uri);
}
Produces the output:
$ ./testcase
Err(InvalidUri(InvalidAuthority))
The authority is only present when the scheme is followed by //
, otherwise the parser should be parsing everything after the first :
as the path
. Python gets this right, and Go parses this as Opaque
(instead of Host
, but still successfully parses):
Python:
>>> urlparse('urn:isbn:0451450523')
ParseResult(scheme='urn', netloc='', path='isbn:0451450523', params='', query='', fragment='')
Go:
>>> url, _ := url.Parse("urn:isbn:0451450523")
>>> fmt.Println("Host (Opaque):", url.Opaque)
Host (Opaque): isbn:0451450523
Metadata
Metadata
Assignees
Labels
No labels