Fix #1057 - unquote redirection URL on successful OAuth authorization
authorJessica Tallon <jessica@megworld.co.uk>
Mon, 8 Dec 2014 17:00:33 +0000 (17:00 +0000)
committerJessica Tallon <jessica@megworld.co.uk>
Mon, 8 Dec 2014 17:00:33 +0000 (17:00 +0000)
mediagoblin/oauth/views.py

index 1b7c789aa75a6e9b18ae1e9d2c370fe4560c5596..1b4787d6d90b133780868aca71ec1a06b8c8a181 100644 (file)
@@ -15,6 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import datetime
+import urllib
 
 import six
 
@@ -313,10 +314,13 @@ def authorize_finish(request):
             oauth_request.verifier
             )
 
+    # It's come from the OAuth headers so it'll be encoded.
+    redirect_url = urllib.unquote(oauth_request.callback)
+
     return redirect(
             request,
             querystring=querystring,
-            location=oauth_request.callback
+            location=redirect_url
             )
 
 @csrf_exempt