From 571d808d25d3391664a69920d4e0a5cb1418af90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81my=20Bethmont?= Date: Wed, 17 Aug 2011 15:31:24 +0200 Subject: [PATCH] Fixed bad merge. --- requests/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requests/models.py b/requests/models.py index 0d7b67cb..7690f16a 100644 --- a/requests/models.py +++ b/requests/models.py @@ -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: