File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -468,7 +468,7 @@ impl Url {
468468 }
469469
470470 // Add the filename if they are not the same
471- if base_filename != url_filename {
471+ if !relative . is_empty ( ) || base_filename != url_filename {
472472 // If the URIs filename is empty this means that it was a directory
473473 // so we'll have to append a '/'.
474474 //
Original file line number Diff line number Diff line change @@ -1084,6 +1084,16 @@ fn test_make_relative() {
10841084 "http://127.0.0.1:8080/test/video?baz=meh#456" ,
10851085 "video?baz=meh#456" ,
10861086 ) ,
1087+ (
1088+ "http://127.0.0.1:8080/file.txt" ,
1089+ "http://127.0.0.1:8080/test/file.txt" ,
1090+ "test/file.txt" ,
1091+ ) ,
1092+ (
1093+ "http://127.0.0.1:8080/not_equal.txt" ,
1094+ "http://127.0.0.1:8080/test/file.txt" ,
1095+ "test/file.txt" ,
1096+ ) ,
10871097 ] ;
10881098
10891099 for ( base, uri, relative) in & tests {
You can’t perform that action at this time.
0 commit comments