Fixed bad merge.
authorJérémy Bethmont <jeremy.bethmont@gmail.com>
Wed, 17 Aug 2011 13:31:24 +0000 (15:31 +0200)
committerJérémy Bethmont <jeremy.bethmont@gmail.com>
Wed, 17 Aug 2011 13:31:24 +0000 (15:31 +0200)
requests/models.py

index 0d7b67c..7690f16 100644 (file)
@@ -230,7 +230,8 @@ class Request(object):
 
                 # Facilitate non-RFC2616-compliant 'location' headers
                 # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource')
-                url = urljoin(r.url, urllib.quote(urllib.unquote(url)))
+                if not urlparse(url).netloc:
+                    url = urljoin(r.url, urllib.quote(urllib.unquote(url)))
 
                 # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4
                 if r.status_code is 303: