From: Ryan Kelly Date: Thu, 17 Nov 2011 22:03:28 +0000 (+1100) Subject: Dont use requote_path when dealing with redirects. X-Git-Tag: v0.8.2~18^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=390024329756db774d5b044ebb124f58ef2ba503;p=services%2Fpython-requests.git Dont use requote_path when dealing with redirects. This was breaking redirect locations with a query string, by quoting the question-mark. Since the path will be passed through requote_path on the next request anyway, doing it here seems unnecessary. --- diff --git a/requests/models.py b/requests/models.py index dd2dbc0..8d33c32 100644 --- a/requests/models.py +++ b/requests/models.py @@ -214,7 +214,7 @@ class Request(object): # Facilitate non-RFC2616-compliant 'location' headers # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource') if not urlparse(url).netloc: - url = urljoin(r.url, requote_path(url)) + url = urljoin(r.url, url) # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4 if r.status_code is codes.see_other: