[FIX] http: fix forward-port of eaa3682bb6

Forward-ported at
1b50c829ef. b4429c2a91
changed the import to allow for either urllib or urlparse.
This commit is contained in:
Joren Van Onder
2017-06-15 18:31:57 -07:00
parent acfebff880
commit b41a987767
+1 -1
View File
@@ -167,7 +167,7 @@ def redirect_with_hash(url, code=303):
# See extensive test page at http://greenbytes.de/tech/tc/httpredirects/
if request.httprequest.user_agent.browser in ('firefox',):
return werkzeug.utils.redirect(url, code)
if urlparse.urlparse(url, scheme='http').scheme not in ('http', 'https'):
if urlparse(url, scheme='http').scheme not in ('http', 'https'):
url = 'http://' + url
url = url.replace("'", "%27").replace("<", "%3C")
return "<html><head><script>window.location = '%s' + location.hash;</script></head></html>" % url