Skip to content

Commit bca9ddd

Browse files
committed
Consuming the path as the spec states.
1 parent 1a4e977 commit bca9ddd

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,11 +500,11 @@ impl Url {
500500
assert_eq!(self.path_start, self.scheme_end + 1);
501501
}
502502
if let Some(start) = self.query_start {
503-
assert!(start > self.path_start);
503+
assert!(start >= self.path_start);
504504
assert_eq!(self.byte_at(start), b'?');
505505
}
506506
if let Some(start) = self.fragment_start {
507-
assert!(start > self.path_start);
507+
assert!(start >= self.path_start);
508508
assert_eq!(self.byte_at(start), b'#');
509509
}
510510
if let (Some(query_start), Some(fragment_start)) = (self.query_start, self.fragment_start) {

src/parser.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ impl<'a> Parser<'a> {
10221022
&mut self,
10231023
scheme_type: SchemeType,
10241024
has_host: &mut bool,
1025-
mut input: Input<'i>,
1025+
input: Input<'i>,
10261026
) -> Input<'i> {
10271027
let path_start = self.serialization.len();
10281028
let (maybe_c, remaining) = input.split_first();
@@ -1049,10 +1049,7 @@ impl<'a> Parser<'a> {
10491049
return self.parse_fragment_2(remaining);
10501050
}
10511051
// Otherwise, if c is not the EOF code point:
1052-
if !remaining.is_empty() {
1053-
return self.parse_path(scheme_type, has_host, path_start, input);
1054-
}
1055-
input
1052+
self.parse_path(scheme_type, has_host, path_start, input)
10561053
}
10571054

10581055
pub fn parse_query_2<'i>(

0 commit comments

Comments
 (0)