Cookies are ignored on redirects
- Dominant language
- Dart
- Stars
- 143
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Description
Hi, it appears that this library ignores the cookies provided by the `Set-Cookie` header in a 301/302 redirect.
**My best guess as to what's causing this:** when Dart's HTTP library has `followRedirects = true`, **ONLY** the headers from the final destination are returned, meaning the headers from the prior responses are totally lost. ☹️
Possible workaround could be:
1. Use `final request = Request(...)` for all methods
2. Set `request.followRedirects = false`
3. Do `var response = _handleHttpResponse(...)` before return
4. Check if `response.statusCode` is 301/302. **If true:** Set `response = _httpRequest(HttpMethod.GET, response.headers['location'], ...)`
5. `return response`
Contributor guide
Assessment
This issue has not been assessed yet.