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 @@ -470,7 +470,7 @@ impl Url {
470470 }
471471
472472 // Add the filename if they are not the same
473- if base_filename != url_filename {
473+ if !relative . is_empty ( ) || base_filename != url_filename {
474474 // If the URIs filename is empty this means that it was a directory
475475 // so we'll have to append a '/'.
476476 //
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