Join with the latest URL not the first one.
authorJeremy Selier <jerem.selier@gmail.com>
Tue, 2 Aug 2011 15:51:21 +0000 (18:51 +0300)
committerJeremy Selier <jerem.selier@gmail.com>
Tue, 2 Aug 2011 15:51:21 +0000 (18:51 +0300)
requests/models.py

index 55a6a48..5195431 100644 (file)
@@ -197,7 +197,7 @@ class Request(object):
 
                 # Facilitate non-RFC2616-compliant 'location' headers
                 # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource')
-                url = urljoin(self.url, url)
+                url = urljoin(r.url, url)
 
                 # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4
                 if r.status_code is 303: