diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/patchwork/views/xmlrpc.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/patchwork/views/xmlrpc.py b/apps/patchwork/views/xmlrpc.py index f493cf7..f7a8dac 100644 --- a/apps/patchwork/views/xmlrpc.py +++ b/apps/patchwork/views/xmlrpc.py @@ -51,10 +51,18 @@ class PatchworkXMLRPCDispatcher(SimpleXMLRPCDispatcher): def _user_for_request(self, request): - if not request.META.has_key('HTTP_AUTHORIZATION'): + auth_header = None + + if request.META.has_key('HTTP_AUTHORIZATION'): + auth_header = request.META.get('HTTP_AUTHORIZATION') + elif request.META.has_key('Authorization'): + auth_header = request.META.get('Authorization') + + if auth_header is None or auth_header == '': raise Exception("No authentication credentials given") - str = request.META.get('HTTP_AUTHORIZATION').strip() + str = auth_header.strip() + if not str.startswith('Basic '): raise Exception("Authentication scheme not supported") |