From: xray7224 Date: Mon, 29 Jul 2013 16:48:53 +0000 (+0100) Subject: Fix problem causing exception when invalid Authentication header provided X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=cae55705b154c9c78380678ca340a124220c2774;p=mediagoblin.git Fix problem causing exception when invalid Authentication header provided --- diff --git a/mediagoblin/oauth/tools/request.py b/mediagoblin/oauth/tools/request.py index 6e484bb6..5ce2da77 100644 --- a/mediagoblin/oauth/tools/request.py +++ b/mediagoblin/oauth/tools/request.py @@ -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('"')