enhance: thread-safe CookieJar, SameSite cookie attr, dynamic Google countries
- 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:
10
cookiejar.go
10
cookiejar.go
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user