fix cookie path parsing

This commit is contained in:
Halil Durak
2025-10-14 12:08:36 +03:00
parent cf9ecbd9fd
commit 6af8add7ff

View File

@@ -385,7 +385,11 @@ pub const Cookie = struct {
return "/"; return "/";
} }
return arena.dupe(u8, url_path); const last = std.mem.lastIndexOfScalar(u8, url_path[1..], '/') orelse {
return "/";
};
return arena.dupe(u8, url_path[0 .. last + 1]);
} }
pub fn parseDomain(arena: Allocator, maybe_url: ?URL, explicit_domain: ?[]const u8) ![]const u8 { pub fn parseDomain(arena: Allocator, maybe_url: ?URL, explicit_domain: ?[]const u8) ![]const u8 {