From 07198b71ff78c727b900888fabd16dfd216a28ea Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Wed, 2 Sep 2026 07:28:25 +0800 Subject: [PATCH] fix comments --- src/browser/webapi/storage/Cookie.zig | 6 +----- src/server/cdp/domains/network.zig | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/browser/webapi/storage/Cookie.zig b/src/browser/webapi/storage/Cookie.zig index e6e17c8e0..0bcc72ed5 100644 --- a/src/browser/webapi/storage/Cookie.zig +++ b/src/browser/webapi/storage/Cookie.zig @@ -584,8 +584,6 @@ pub const Jar = struct { request_time: ?u64 = null, is_navigation: bool = true, prefix: ?[]const u8 = null, - // null means there is no initiating document (a browser-initiated - // request), which is treated as same-site with any target. origin_url: ?SiteForCookies = null, }; pub fn forRequest(self: *Jar, target_url: [:0]const u8, writer: anytype, opts: LookupOpts) !void { @@ -653,7 +651,6 @@ fn areCookiesEqual(a: *const Cookie, b: *const Cookie) bool { } pub fn areSameSite(maybe_origin_url: ?SiteForCookies, target_host: []const u8) bool { - // No initiating document (browser-initiated request). const origin_url = switch (maybe_origin_url orelse return true) { .none => return false, .url => |url| url, @@ -1054,8 +1051,7 @@ test "Jar: forRequest with a null site-for-cookies" { // .none is the site-for-cookies of a frame whose ancestor chain contains // a cross-site document. Even though the target here is the cookies' own - // site, the request is cross-site: Strict is withheld. (Lax still rides - // navigations; whether a subframe load should count as one is #240.) + // site, the request is cross-site: Strict is withheld. try expectCookies("lax=2; none=3", &jar, victim_url, .{ .origin_url = .none, .is_http = true, diff --git a/src/server/cdp/domains/network.zig b/src/server/cdp/domains/network.zig index c6a830a91..b1d83797c 100644 --- a/src/server/cdp/domains/network.zig +++ b/src/server/cdp/domains/network.zig @@ -1303,7 +1303,7 @@ const EchoDriver = struct { .url = "http://127.0.0.1:9582/echo_body", .body = body, .cookie_jar = null, - .cookie_origin = "http://127.0.0.1:9582/", + .cookie_origin = .{ .url = "http://127.0.0.1:9582/" }, .resource_type = .fetch, .notification = bc.session.notification, .ctx = &driver,