| ... | @@ -90,7 +90,6 @@ pub const URL = struct { | ... | @@ -90,7 +90,6 @@ pub const URL = struct { |
| 90 | var href = ManyArrayList(8 + 7, u8).init(alloc); | 90 | var href = ManyArrayList(8 + 7, u8).init(alloc); |
| 91 | defer href.deinit(); | 91 | defer href.deinit(); |
| 92 | var hostname_kind: HostKind = .unset; | 92 | var hostname_kind: HostKind = .unset; |
| 93 | var has_opaque_path = false; | | |
| 94 | // scheme | 93 | // scheme |
| 95 | // : | 94 | // : |
| 96 | // // | 95 | // // |
| ... | @@ -181,7 +180,6 @@ pub const URL = struct { | ... | @@ -181,7 +180,6 @@ pub const URL = struct { |
| 181 | else { | 180 | else { |
| 182 | href.clear(10); | 181 | href.clear(10); |
| 183 | state = .opaque_path; | 182 | state = .opaque_path; |
| 184 | has_opaque_path = true; | | |
| 185 | } | 183 | } |
| 186 | } | 184 | } |
| 187 | // 3. Otherwise, if state override is not given, set buffer to the empty string, state to no scheme state, and start over (from the first code point in input). | 185 | // 3. Otherwise, if state override is not given, set buffer to the empty string, state to no scheme state, and start over (from the first code point in input). |
| ... | @@ -833,7 +831,7 @@ pub const URL = struct { | ... | @@ -833,7 +831,7 @@ pub const URL = struct { |
| 833 | } | 831 | } |
| 834 | | 832 | |
| 835 | var path_offset: usize = 0; | 833 | var path_offset: usize = 0; |
| 836 | if (hostname_kind == .unset and !has_opaque_path and std.mem.startsWith(u8, href.items(10), "//")) { | 834 | if (hostname_kind == .unset and std.mem.startsWith(u8, href.items(10), "//")) { |
| 837 | try href.replace(10, 0, 0, "/."); | 835 | try href.replace(10, 0, 0, "/."); |
| 838 | path_offset += 2; | 836 | path_offset += 2; |
| 839 | } | 837 | } |