diff options
author | 2021-09-09 23:33:34 -0700 | |
---|---|---|
committer | 2021-09-09 23:33:34 -0700 | |
commit | fc907e2f81698d89502fb2ee0375e6d98a492c13 (patch) | |
tree | e775c2479b334ec901f61b5c0ccfab0102ff679e /src/query_string_map.zig | |
parent | 8a02ad48a5eb1319c1bf3e9eb97e013924db875f (diff) | |
download | bun-jarred/fetch-experiment.tar.gz bun-jarred/fetch-experiment.tar.zst bun-jarred/fetch-experiment.zip |
currentjarred/fetch-experiment
Diffstat (limited to '')
-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]; } |