Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix test_preserve_chunked_on_retry_after flakiness (urllib3#1816)
Without `Content-Length: 0` or `Connection: close`, the client can try reading more data after the socket gets closed. If it does try, it's going to fail with "Connection reset by peer". This was happening on Windows despite the `preload_content=False` setting. Setting those headers fixes the issue and allows omitting `preload_content=False`. Since I'm a good citizen and want to close the sockets, I collect them and close them when the connection pool is closed. (I'm also renaming the test since it's specifically about the Retry-After header.)
- Loading branch information