Merge pull request #2353 from mattrobenolt/patch-1

url was already parsed, don't urlparse twice
This commit is contained in:
2014-11-30 14:11:52 -05:00
+1 -1
View File
@@ -129,7 +129,7 @@ class SessionRedirectMixin(object):
# Facilitate relative 'location' headers, as allowed by RFC 7231.
# (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource')
# Compliant with RFC3986, we percent encode the url.
if not urlparse(url).netloc:
if not parsed.netloc:
url = urljoin(resp.url, requote_uri(url))
else:
url = requote_uri(url)