'Cookie:' header dissapears on redirect
Describe the bug Had a watch start failing recently due to being logged out. The only change was the page now redirects to a different page. I double checked the request in mitmproxy and the original request includes my cookie header, but the request following the redirect doesn't have the cookie header.
Version v0.50.5
How did you install? docker compose
To Reproduce
Steps to reproduce the behavior:
- Create a watch
- Url: https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org/cookies
- Fetch method: 'Basic fast Plaintext/HTTP Client'
- Advanced options -> Request headers:
Cookie: examplecookie=3
Expected behavior Cookie header is sent with both the initial request and redirected request
I'd expect to see my cookies:
But instead they're missing:
Screenshots
Additional context
Dug in a bit and found that requests drops manually-set cookie headers when following a redirect in a session (https://github.com/psf/requests/blob/91a3eabd3dcc4d7f36dd8249e4777a90ef9b4305/src/requests/sessions.py#L235)
It doesn't look like they're interested in changing that behavior (https://github.com/psf/requests/issues/5714)
thanks for the report and digging around, so i'm not sure what we can do here if requests drops it on redirect?
just tested it on Playwright and confirmed that the same issue occurs