Skip to content

Commit ce22785

Browse files
committed
truncate at the right place.
1 parent 096ef0b commit ce22785

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
@@ -1139,11 +1139,7 @@ impl<'a> Parser<'a> {
11391139
".." | "%2e%2e" | "%2e%2E" | "%2E%2e" | "%2E%2E" | "%2e." | "%2E." | ".%2e"
11401140
| ".%2E" => {
11411141
debug_assert!(self.serialization.as_bytes()[segment_start - 1] == b'/');
1142-
if ends_with_slash {
1143-
self.serialization.truncate(segment_start - 1); // Truncate "/../"
1144-
} else {
1145-
self.serialization.truncate(segment_start); // Truncate ".."
1146-
}
1142+
self.serialization.truncate(segment_start - 1); // Truncate "/.."
11471143
self.pop_path(scheme_type, path_start);
11481144
// 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.
11491145
if ends_with_slash && !self.serialization.ends_with("/") {

0 commit comments

Comments
 (0)