aboutsummaryrefslogtreecommitdiff
path: root/src/query_string_map.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-09-09 23:33:34 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-09-09 23:33:34 -0700
commitfc907e2f81698d89502fb2ee0375e6d98a492c13 (patch)
treee775c2479b334ec901f61b5c0ccfab0102ff679e /src/query_string_map.zig
parent8a02ad48a5eb1319c1bf3e9eb97e013924db875f (diff)
downloadbun-jarred/fetch-experiment.tar.gz
bun-jarred/fetch-experiment.tar.zst
bun-jarred/fetch-experiment.zip
Diffstat (limited to '')
-rw-r--r--src/query_string_map.zig7
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];
}