From f6469471bb6c4350b82b37f9c679734b06cfd32d Mon Sep 17 00:00:00 2001 From: nite07 Date: Wed, 4 Dec 2024 21:25:31 +0800 Subject: [PATCH] add Cookie struct --- cf-clearance-scraper.go | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/cf-clearance-scraper.go b/cf-clearance-scraper.go index 7ede570..b2514b4 100644 --- a/cf-clearance-scraper.go +++ b/cf-clearance-scraper.go @@ -16,23 +16,25 @@ type Request struct { SiteKey string `json:"siteKey"` } +type Cookie struct { + Name string `json:"name"` + Value string `json:"value"` + Domain string `json:"domain"` + Path string `json:"path"` + Expires float64 `json:"expires"` + Size int `json:"size"` + HTTPOnly bool `json:"httpOnly"` + Secure bool `json:"secure"` + Session bool `json:"session"` + SameSite string `json:"sameSite"` + Priority string `json:"priority"` + SameParty bool `json:"sameParty"` + SourceScheme string `json:"sourceScheme"` + PartitionKey string `json:"partitionKey"` +} + type Session struct { - Cookies []struct { - Name string `json:"name"` - Value string `json:"value"` - Domain string `json:"domain"` - Path string `json:"path"` - Expires float64 `json:"expires"` - Size int `json:"size"` - HTTPOnly bool `json:"httpOnly"` - Secure bool `json:"secure"` - Session bool `json:"session"` - SameSite string `json:"sameSite"` - Priority string `json:"priority"` - SameParty bool `json:"sameParty"` - SourceScheme string `json:"sourceScheme"` - PartitionKey string `json:"partitionKey"` - } `json:"cookies"` + Cookies []Cookie `json:"cookies"` Headers map[string]string `json:"headers"` Code int `json:"code"` }