Merge pull request #831 from lightpanda-io/log_invalid_cookie_expiry
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
zig-test / zig build dev (push) Has been cancelled
zig-test / browser fetch (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
nightly build / build-linux-x86_64 (push) Has been cancelled
nightly build / build-linux-aarch64 (push) Has been cancelled
nightly build / build-macos-aarch64 (push) Has been cancelled
nightly build / build-macos-x86_64 (push) Has been cancelled
wpt / web platform tests json output (push) Has been cancelled
wpt / perf-fmt (push) Has been cancelled

use logger for invalid cookie expiry
This commit is contained in:
Karl Seguin
2025-07-02 10:11:20 +08:00
committed by GitHub

View File

@@ -296,7 +296,12 @@ pub const Cookie = struct {
} }
if (exp_dt) |dt| { if (exp_dt) |dt| {
normalized_expires = @floatFromInt(dt.unix(.seconds)); normalized_expires = @floatFromInt(dt.unix(.seconds));
} else std.debug.print("Invalid cookie expires value: {s}\n", .{expires_}); } else {
// Algolia, for example, will call document.setCookie with
// an expired value which is literally 'Invalid Date'
// (it's trying to do something like: `new Date() + undefined`).
log.debug(.web_api, "cookie expires date", .{ .date = expires_ });
}
} }
} }