Allow authentication token to be set anywhere.
authorAntony Chazapis <chazapis@gmail.com>
Thu, 14 Jul 2011 10:10:37 +0000 (13:10 +0300)
committerAntony Chazapis <chazapis@gmail.com>
Thu, 14 Jul 2011 10:10:37 +0000 (13:10 +0300)
pithos/api/auth.py

index 0508ace..431bbfb 100644 (file)
@@ -37,6 +37,6 @@ from django.conf import settings
 class DummyAuthMiddleware(object):
     def process_request(self, request):
         token = request.META.get('HTTP_X_AUTH_TOKEN', None)
-        if token is None and request.META.get('CONTENT_TYPE', '').startswith('multipart/form-data'):
-            token = request.POST.get('X-Auth-Token', None)
+        if token is None:
+            token = request.REQUEST.get('X-Auth-Token', None)
         request.user = settings.AUTH_TOKENS.get(token, None)