Skip to content

Commit 16ffff0

Browse files
committed
---
yaml --- r: 23007 b: refs/heads/master c: d3a9bb1 h: refs/heads/master i: 23005: acdd5fd 23003: 1ce320c 22999: e54636f 22991: cfe5d15 22975: 1a5496a v: v3
1 parent bfc7567 commit 16ffff0

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 74370042aa698c0360aadf356ccc4305cc2c0cd2
2+
refs/heads/master: d3a9bb1bd4a1d510bbaca2ab1121e4c85a239247
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/src/libstd/net_url.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ fn get_path(rawurl: ~str, authority : bool) ->
538538
match c {
539539
'A' to 'Z' | 'a' to 'z' | '0' to '9' | '&' |'\'' | '(' | ')' | '.'
540540
| '@' | ':' | '%' | '/' | '+' | '!' | '*' | ',' | ';' | '='
541-
| '_' => {
541+
| '_' | '-' => {
542542
again;
543543
}
544544
'?' | '#' => {
@@ -804,6 +804,14 @@ mod tests {
804804
assert url.path == ~"/file_name.html";
805805
}
806806

807+
#[test]
808+
fn test_url_with_dashes() {
809+
let urlstr = ~"http://dotcom.com/file-name.html";
810+
let url = from_str(urlstr).get();
811+
#debug("url: %?", url);
812+
assert url.path == ~"/file-name.html";
813+
}
814+
807815
#[test]
808816
fn test_no_scheme() {
809817
assert result::is_err(get_scheme(~"noschemehere.html"));

0 commit comments

Comments
 (0)