mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-29 16:10:04 +00:00
Fixup cookies management
This commit is contained in:
@@ -351,6 +351,19 @@ pub const TransferAsRequestWriter = struct {
|
||||
try jws.objectField(hdr.name);
|
||||
try jws.write(hdr.value);
|
||||
}
|
||||
if (transfer.req.cookie_jar) |jar| {
|
||||
var aw: std.Io.Writer.Allocating = .init(transfer.arena.allocator());
|
||||
try jar.forRequest(transfer.req.url, &aw.writer, .{
|
||||
.is_http = true,
|
||||
.origin_url = transfer.req.url,
|
||||
.is_navigation = transfer.req.resource_type == .document,
|
||||
});
|
||||
const cookie_str = aw.written();
|
||||
if (cookie_str.len > 0) {
|
||||
try jws.objectField("Cookie");
|
||||
try jws.write(cookie_str);
|
||||
}
|
||||
}
|
||||
try jws.endObject();
|
||||
}
|
||||
try jws.endObject();
|
||||
|
||||
Reference in New Issue
Block a user