fix: secure field lost in cookie round-trip & batch AddCookies failure #77

Merged
steve merged 1 commits from fix/75-cookie-secure-field-roundtrip into main 2026-02-24 02:14:43 +00:00
Collaborator

Summary

  • Map the Secure field in both cookieToPlaywrightOptionalCookie and playwrightCookieToCookie — previously it was silently dropped, causing cookies with __Secure-/__Host- prefixes to be rejected by Chromium
  • Replace the batch AddCookies call with one-by-one cookie adding, logging slog.Warn on failure instead of failing browser creation entirely
  • Add 5 unit tests for the conversion functions covering Secure true/false and edge cases

Closes #75

## Summary - Map the `Secure` field in both `cookieToPlaywrightOptionalCookie` and `playwrightCookieToCookie` — previously it was silently dropped, causing cookies with `__Secure-`/`__Host-` prefixes to be rejected by Chromium - Replace the batch `AddCookies` call with one-by-one cookie adding, logging `slog.Warn` on failure instead of failing browser creation entirely - Add 5 unit tests for the conversion functions covering `Secure` true/false and edge cases Closes #75
Claude added 1 commit 2026-02-24 02:13:29 +00:00
fix: map Secure field in cookie conversions and add per-cookie error handling
All checks were successful
CI / vet (pull_request) Successful in 1m7s
CI / build (pull_request) Successful in 1m7s
CI / test (pull_request) Successful in 1m10s
debf0ee2ed
The Secure field was dropped in both Playwright<->internal cookie
conversion functions, causing cookies with __Secure-/__Host- prefixes
to be rejected by Chromium. Additionally, batch AddCookies meant one
invalid cookie would fail browser creation entirely.

Changes:
- Map Secure field in cookieToPlaywrightOptionalCookie and
  playwrightCookieToCookie
- Add cookies one-by-one with slog.Warn on failure instead of
  failing the entire batch
- Add unit tests for both conversion functions

Closes #75

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
steve merged commit 39371dc261 into main 2026-02-24 02:14:43 +00:00
steve deleted branch fix/75-cookie-secure-field-roundtrip 2026-02-24 02:14:43 +00:00
Sign in to join this conversation.