Skip to content

Commit e0920f3

Browse files
committed
truncate at the right place.
1 parent 401a892 commit e0920f3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/parser.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,11 +1157,7 @@ impl<'a> Parser<'a> {
11571157
".." | "%2e%2e" | "%2e%2E" | "%2E%2e" | "%2E%2E" | "%2e." | "%2E." | ".%2e"
11581158
| ".%2E" => {
11591159
debug_assert!(self.serialization.as_bytes()[segment_start - 1] == b'/');
1160-
if ends_with_slash {
1161-
self.serialization.truncate(segment_start - 1); // Truncate "/../"
1162-
} else {
1163-
self.serialization.truncate(segment_start); // Truncate ".."
1164-
}
1160+
self.serialization.truncate(segment_start - 1); // Truncate "/.."
11651161
self.pop_path(scheme_type, path_start);
11661162
// and then if neither c is U+002F (/), nor url is special and c is U+005C (\), append the empty string to url’s path.
11671163
if ends_with_slash && !self.serialization.ends_with("/") {

0 commit comments

Comments
 (0)