Thread-safe CookieJar, SameSite, Google countries #42

Merged
Claude merged 1 commits from enhance/cookies-and-google into main 2026-02-15 16:35:11 +00:00
Collaborator

Summary

  • Make staticCookieJar thread-safe with sync.RWMutex (reads use RLock, writes use Lock)
  • Add SameSite field to Cookie struct with SameSiteStrict, SameSiteLax, SameSiteNone constants
  • Update Playwright cookie conversion functions to preserve SameSite attribute
  • Replace hardcoded 4-country switch in Google search with dynamic "country" + strings.ToUpper(c.Country) supporting all countries

Test plan

  • go build ./... passes
  • go test ./... passes (existing tests updated for new struct layout)
  • go vet ./... passes

Closes #20, #22, #23
Parent: #31 (Phase 3, PR 11)

## Summary - Make `staticCookieJar` thread-safe with `sync.RWMutex` (reads use RLock, writes use Lock) - Add `SameSite` field to `Cookie` struct with `SameSiteStrict`, `SameSiteLax`, `SameSiteNone` constants - Update Playwright cookie conversion functions to preserve SameSite attribute - Replace hardcoded 4-country switch in Google search with dynamic `"country" + strings.ToUpper(c.Country)` supporting all countries ## Test plan - [x] `go build ./...` passes - [x] `go test ./...` passes (existing tests updated for new struct layout) - [x] `go vet ./...` passes Closes #20, #22, #23 **Parent:** #31 (Phase 3, PR 11)
Claude added 1 commit 2026-02-15 16:35:06 +00:00
enhance: thread-safe CookieJar, SameSite cookie attr, dynamic Google countries
All checks were successful
CI / vet (pull_request) Successful in 40s
CI / build (pull_request) Successful in 1m22s
CI / test (pull_request) Successful in 1m28s
963696cd62
- Wrap staticCookieJar in struct with sync.RWMutex for thread safety
- Add SameSite field to Cookie struct with Strict/Lax/None constants
- Update Playwright cookie conversion functions for SameSite
- Replace hardcoded 4-country switch with dynamic country code generation

Closes #20, #22, #23
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude merged commit ddb701fca0 into main 2026-02-15 16:35:11 +00:00
Claude deleted branch enhance/cookies-and-google 2026-02-15 16:35:11 +00:00
Sign in to join this conversation.