Fix problem causing exception when invalid Authentication header provided
authorxray7224 <jessica@megworld.co.uk>
Mon, 29 Jul 2013 16:48:53 +0000 (17:48 +0100)
committerxray7224 <jessica@megworld.co.uk>
Mon, 29 Jul 2013 16:48:53 +0000 (17:48 +0100)
mediagoblin/oauth/tools/request.py

index 6e484bb674d199038d4cf7e3edc8383dbffc5cca..5ce2da77e24b600cb132a1f41e6ca10fa8a8786e 100644 (file)
@@ -20,8 +20,11 @@ def decode_authorization_header(header):
     tokens = {}
 
     for param in authorization.split(","):
-        key, value = param.split("=")
-        
+        try:
+            key, value = param.split("=")
+        except ValueError:
+            continue
         key = key.lstrip(" ")
         value = value.lstrip(" ").lstrip('"')
         value = value.rstrip(" ").rstrip('"')