From 4293e3fdb20c53d744c38db0c78d18fa62e2d34a Mon Sep 17 00:00:00 2001 From: Mastahyeti Date: Mon, 23 Jan 2012 20:56:05 -0600 Subject: [PATCH 1/2] moved call to pre_request hook, allowing for more meaningful use. --- requests/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/requests/models.py b/requests/models.py index c200896c..82c75729 100644 --- a/requests/models.py +++ b/requests/models.py @@ -152,10 +152,6 @@ class Request(object): self.headers = headers self._poolmanager = _poolmanager - # Pre-request hook. - r = dispatch_hook('pre_request', hooks, self) - self.__dict__.update(r.__dict__) - def __repr__(self): return '' % (self.method) @@ -508,6 +504,10 @@ class Request(object): # Attach Cookie header to request. self.headers['Cookie'] = cookie_header + + # Pre-request hook. + r = dispatch_hook('pre_request', self.hooks, self) + self.__dict__.update(r.__dict__) try: # The inner try .. except re-raises certain exceptions as From 02f6555536a9dee5e5bb83a5e4b96cc6d754c090 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 24 Jan 2012 09:59:41 -0600 Subject: [PATCH 2/2] added myself to authors.rst --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index e367dad5..6611b00d 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -76,3 +76,4 @@ Patches and Suggestions - Chase Sterling - Marty Alchin - takluyver +- Ben Toews (mastahyeti)