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 {
470
470
}
471
471
472
472
// Add the filename if they are not the same
473
- if base_filename != url_filename {
473
+ if !relative . is_empty ( ) || base_filename != url_filename {
474
474
// If the URIs filename is empty this means that it was a directory
475
475
// so we'll have to append a '/'.
476
476
//
Original file line number Diff line number Diff line change @@ -1084,6 +1084,16 @@ fn test_make_relative() {
1084
1084
"http://127.0.0.1:8080/test/video?baz=meh#456" ,
1085
1085
"video?baz=meh#456" ,
1086
1086
) ,
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
+ ) ,
1087
1097
] ;
1088
1098
1089
1099
for ( base, uri, relative) in & tests {
You can’t perform that action at this time.
0 commit comments