File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -537,7 +537,8 @@ fn get_path(rawurl: ~str, authority : bool) ->
537
537
for str:: each_chari( rawurl) |i, c| {
538
538
match c {
539
539
'A' to 'Z' | 'a' to 'z' | '0' to '9' | '&' |'\'' | '(' | ')' | '.'
540
- | '@' | ':' | '%' | '/' | '+' | '!' | '*' | ',' | ';' | '=' => {
540
+ | '@' | ':' | '%' | '/' | '+' | '!' | '*' | ',' | ';' | '='
541
+ | '_' => {
541
542
again;
542
543
}
543
544
'?' | '#' => {
@@ -795,6 +796,14 @@ mod tests {
795
796
assert url. path == ~"/";
796
797
}
797
798
799
+ #[ test]
800
+ fn test_url_with_underscores ( ) {
801
+ let urlstr = ~"http: //dotcom.com/file_name.html";
802
+ let url = from_str ( urlstr) . get ( ) ;
803
+ #debug ( "url: %?" , url) ;
804
+ assert url. path == ~"/file_name. html ";
805
+ }
806
+
798
807
#[ test]
799
808
fn test_no_scheme ( ) {
800
809
assert result:: is_err ( get_scheme ( ~"noschemehere. html ") ) ;
You can’t perform that action at this time.
0 commit comments