url was already parsed, don't urlparse twice

This commit is contained in:
Matt Robenolt
2014-11-23 17:54:44 -08:00
parent 9dc660269f
commit 2a5364cf72
+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)