kennethreitz/requests — pull request #1139 by alexsdutton (2013-01-24 15:34:45+00:00)
Title: HTTPDigestAuth et al don't preserve stream, proxies etc.

`HTTPDigestAuth.handle_401()` replaces the original response with another by doing `r.connection.send(r.request)`. This ignores the arguments originally passed to `Session.request()` such as `stream`, `proxies`, `timeout`, `verify` and `cert`.

`HTTPDigestAuth` (and other hooks that behave similarly) need a way to perform additional requests in the same context as the original. This could be done by having `request.Session` set the relevant instance attributes in `__init__()` and then doing `resp.session = self` after `self.send()`.

It's possible that `requests.request()` et al should also pass those arguments to the `Session.__init__()`, not `Session.request()`.