Fix failing tests.
authorIan Cordasco <graffatcolmingov@gmail.com>
Tue, 22 Jan 2013 01:21:08 +0000 (20:21 -0500)
committerIan Cordasco <graffatcolmingov@gmail.com>
Tue, 22 Jan 2013 01:21:08 +0000 (20:21 -0500)
requests/sessions.py

index 173a481..4ad8d6a 100644 (file)
@@ -275,6 +275,10 @@ class Session(SessionRedirectMixin):
         # Prepare the Request.
         prep = req.prepare()
 
+        # If auth hooks are present, they aren't passed to `dispatch_hook`
+        # As such, we need to update the original hooks dictionary with them
+        hooks.update(prep.hooks)
+
         # Send the request.
         resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)