fix comments

This commit is contained in:
Karl Seguin committed 2026-09-02 07:28:25 +08:00
1 parent add8a8c003
commit 07198b71ff
2 files changed
+2 -6

No files matched your search

+1 -5
View File
@@ -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,
+1 -1
View File
@@ -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,