From 92baa1671dd2a9dcc43d14f3a893f0e7f9a4b34d Mon Sep 17 00:00:00 2001 From: Philipp Tanlak Date: Mon, 26 Feb 2024 21:05:35 +0100 Subject: Improve cookie support for browser mode --- modules/cookies/cookies.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/cookies/cookies.go') diff --git a/modules/cookies/cookies.go b/modules/cookies/cookies.go index 2f57a3f..2af2a27 100644 --- a/modules/cookies/cookies.go +++ b/modules/cookies/cookies.go @@ -51,6 +51,10 @@ func (m Module) AdaptTransport(t http.RoundTripper) http.RoundTripper { return flyscrape.RoundTripFunc(func(r *http.Request) (*http.Response, error) { for _, store := range stores { for _, cookie := range store.Cookies(r.URL) { + // Unquote cookie value + if len(cookie.Value) >= 2 && cookie.Value[0] == '"' && cookie.Value[len(cookie.Value)-1] == '"' { + cookie.Value = cookie.Value[1 : len(cookie.Value)-2] + } r.AddCookie(cookie) } } -- cgit v1.2.3