diff options
| author | Philipp Tanlak <philipp.tanlak@gmail.com> | 2024-02-26 21:05:35 +0100 |
|---|---|---|
| committer | Philipp Tanlak <philipp.tanlak@gmail.com> | 2024-02-26 21:05:35 +0100 |
| commit | 92baa1671dd2a9dcc43d14f3a893f0e7f9a4b34d (patch) | |
| tree | 6b6d25e81d0ac2b3ae53ea777ea1482f4be94563 /modules/cookies/cookies.go | |
| parent | 74dbcb0f58fc402a17799c0f6a6c3c775df0b760 (diff) | |
Improve cookie support for browser mode
Diffstat (limited to 'modules/cookies/cookies.go')
| -rw-r--r-- | modules/cookies/cookies.go | 4 |
1 files changed, 4 insertions, 0 deletions
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) } } |