Skip to content

Commit d26776a

Browse files
committed
auto merge of #10340 : eholk/rust/url, r=brson
According to http://tools.ietf.org/html/rfc3986, ~ is a legal character in URLs.
2 parents 27eb85d + 0a478b4 commit d26776a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libextra/url.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -581,7 +581,7 @@ fn get_path(rawurl: &str, authority: bool) ->
581581
match c {
582582
'A' .. 'Z' | 'a' .. 'z' | '0' .. '9' | '&' |'\'' | '(' | ')' | '.'
583583
| '@' | ':' | '%' | '/' | '+' | '!' | '*' | ',' | ';' | '='
584-
| '_' | '-' => {
584+
| '_' | '-' | '~' => {
585585
continue;
586586
}
587587
'?' | '#' => {
@@ -824,15 +824,15 @@ mod tests {
824824
825825
#[test]
826826
fn test_url_parse() {
827-
let url = ~"http://user:[email protected]:8080/doc?s=v#something";
827+
let url = ~"http://user:[email protected]:8080/doc/~u?s=v#something";
828828

829829
let up = from_str(url);
830830
let u = up.unwrap();
831831
assert_eq!(&u.scheme, &~"http");
832832
assert_eq!(&u.user, &Some(UserInfo::new(~"user", Some(~"pass"))));
833833
assert_eq!(&u.host, &~"rust-lang.org");
834834
assert_eq!(&u.port, &Some(~"8080"));
835-
assert_eq!(&u.path, &~"/doc");
835+
assert_eq!(&u.path, &~"/doc/~u");
836836
assert_eq!(&u.query, &~[(~"s", ~"v")]);
837837
assert_eq!(&u.fragment, &Some(~"something"));
838838
}

0 commit comments

Comments
 (0)