diff options
Diffstat (limited to 'src/query_string_map.zig')
-rw-r--r-- | src/query_string_map.zig | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/query_string_map.zig b/src/query_string_map.zig index ddf90750f..4c451806d 100644 --- a/src/query_string_map.zig +++ b/src/query_string_map.zig @@ -226,7 +226,12 @@ pub const URL = struct { } if (base.len > path_offset and base[path_offset] == '/' and offset > 0) { - url.pathname = base[path_offset..std.math.min(offset, base.len)]; + if (url.search.len > 0) { + url.pathname = base[path_offset..std.math.min(offset + url.search.len, base.len)]; + } else { + url.pathname = base[path_offset..std.math.min(offset, base.len)]; + } + url.origin = base[0..path_offset]; } |