mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
Update src/url.zig
Co-authored-by: Sjors <72333389+sjorsdonkers@users.noreply.github.com>
This commit is contained in:
15
src/url.zig
15
src/url.zig
@@ -153,18 +153,11 @@ pub const URL = struct {
|
||||
std.debug.assert(out[out_i - 1] == '/');
|
||||
|
||||
out_i -= 2;
|
||||
while (out_i > 1) {
|
||||
const next = out_i - 1;
|
||||
if (out[next] == '/') {
|
||||
// <= to deal with the hack-ish protocol_end which will be
|
||||
// off-by-one between http and https
|
||||
if (out_i <= protocol_end) {
|
||||
return error.InvalidURL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
out_i = next;
|
||||
while (out_i > 1 and out[out_i - 1] != '/') {
|
||||
out_i -= 1;
|
||||
}
|
||||
// <= to deal with the hack-ish protocol_end which will be off-by-one between http and https
|
||||
if (out_i <= protocol_end) return error.InvalidURL;
|
||||
in_i += 3;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user