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

- 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>
This commit is contained in:
2026-02-15 16:34:54 +00:00
parent 0ba9cc9b98
commit 963696cd62
5 changed files with 104 additions and 59 deletions

View File

@@ -6,6 +6,15 @@ import (
"time"
)
// SameSite represents the SameSite attribute of a cookie.
type SameSite string
const (
SameSiteStrict SameSite = "Strict"
SameSiteLax SameSite = "Lax"
SameSiteNone SameSite = "None"
)
type Cookie struct {
Host string
Path string
@@ -14,6 +23,7 @@ type Cookie struct {
HttpOnly bool
Name string
Value string
SameSite SameSite
}
func (c Cookie) IsTargetMatch(target string) (bool, error) {