Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dravenk committed Aug 19, 2024
1 parent d9cc4e2 commit a9c56b1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/url.zig
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,18 @@ pub fn parseQuery(uri_query: []const u8) StringHashMap([]const u8) {
break;
}
var kv = std.mem.splitSequence(u8, pair.?, "=");
if (kv.index == null) {
if (kv.buffer.len == 0) {
break;
}
const key: []const u8 = kv.next().?;
const value: []const u8 = kv.next().?;
querymap.put(key, value) catch break;
const key = kv.next();
if (key == null) {
break;
}
const value = kv.next();
if (value == null) {
break;
}
querymap.put(key.?, value.?) catch break;
}
return querymap;
}

0 comments on commit a9c56b1

Please sign in to comment.