forked from hyperium/http
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This changes the URI parser to allow URIs of the forms * scheme:/absolute/path * scheme:///absolute/path It does impact HTTP URI parsing in that HTTP URIs without an authority part are now allowed. Fixes issue hyperium#323
- Loading branch information
Showing
3 changed files
with
51 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,6 +254,34 @@ test_parse! { | |
port = Port::from_str("1234").ok(), | ||
} | ||
|
||
test_parse! { | ||
test_uri_parse_scheme_single_slash, | ||
"x:/y", | ||
[], | ||
|
||
scheme = part!("x"), | ||
path = "/y", | ||
} | ||
|
||
test_parse! { | ||
test_uri_parse_scheme_triple_slash, | ||
"x:///y", | ||
[], | ||
|
||
scheme = part!("x"), | ||
path = "/y", | ||
} | ||
|
||
|
||
test_parse! { | ||
test_uri_parse_scheme_file, | ||
"file:/foo/bar", | ||
["file:///foo/bar"], | ||
|
||
scheme = part!("file"), | ||
path = "/foo/bar", | ||
} | ||
|
||
test_parse! { | ||
test_userinfo1, | ||
"http://a:[email protected]:1234/", | ||
|
@@ -419,7 +447,6 @@ fn test_uri_parse_error() { | |
Uri::from_str(s).unwrap_err(); | ||
} | ||
|
||
err("http://"); | ||
err("htt:p//host"); | ||
err("hyper.rs/"); | ||
err("hyper.rs?key=val"); | ||
|