projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cdec20a
)
Dispatch hooks before following redirects
author
Ian Cordasco
<graffatcolmingov@gmail.com>
Wed, 13 Feb 2013 04:00:06 +0000
(23:00 -0500)
committer
Ian Cordasco
<graffatcolmingov@gmail.com>
Wed, 13 Feb 2013 04:00:06 +0000
(23:00 -0500)
Fixes #1183
requests/sessions.py
patch
|
blob
|
history
diff --git
a/requests/sessions.py
b/requests/sessions.py
index 8efcc84b9a98e2f88c1591292808459a6aa88c79..c53ccfc43727e9542ac3ca84508f0a1ce7c56e94 100644
(file)
--- a/
requests/sessions.py
+++ b/
requests/sessions.py
@@
-414,6
+414,9
@@
class Session(SessionRedirectMixin):
# Total elapsed time of the request (approximately)
r.elapsed = datetime.utcnow() - start
+ # Response manipulation hooks
+ r = dispatch_hook('response', hooks, r)
+
# Redirect resolving generator.
gen = self.resolve_redirects(r, request, stream=stream,
timeout=timeout, verify=verify, cert=cert,
@@
-430,9
+433,6
@@
class Session(SessionRedirectMixin):
r = history.pop()
r.history = tuple(history)
- # Response manipulation hooks
- r = dispatch_hook('response', hooks, r)
-
return r
def get_adapter(self, url):