From 3efd5dbab42fb6fe7d4825bbd575d989574c1505 Mon Sep 17 00:00:00 2001 From: David Fischer Date: Thu, 3 Nov 2011 08:05:55 -0700 Subject: [PATCH] A cleaner and more complete fix for auth/redirects --- requests/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requests/models.py b/requests/models.py index 5da414af..d7ba894c 100644 --- a/requests/models.py +++ b/requests/models.py @@ -96,6 +96,7 @@ class Request(object): self.response = Response() #: Authentication tuple to attach to :class:`Request `. + self._auth = auth self.auth = auth_dispatch(auth) #: CookieJar to attach to :class:`Request `. @@ -237,7 +238,7 @@ class Request(object): method=method, # data=self.data, # params=self.params, - auth=self.auth, + auth=self._auth, cookies=self.cookies, redirect=True, config=self.config @@ -338,7 +339,6 @@ class Request(object): r = auth_func(self, *auth_args) self.__dict__.update(r.__dict__) - self.auth = auth_args # Build the Urllib2 Request. req = _Request(url, data=data, headers=headers, method=self.method)