fix redirect with quoted param

This commit is contained in:
Yun Xu
2018-10-15 21:53:11 -07:00
parent 34e51f01d1
commit 277c2ce2d2
2 changed files with 25 additions and 1 deletions

View File

@@ -421,7 +421,7 @@ def redirect(
headers = headers or {}
# URL Quote the URL before redirecting
safe_to = quote_plus(to, safe=":/#?&=@[]!$&'()*+,;")
safe_to = quote_plus(to, safe=":/%#?&=@[]!$&'()*+,;")
# According to RFC 7231, a relative URI is now permitted.
headers["Location"] = safe_to