Commit 1ddea5dd by Matt Drayer

API_KEY header fix

parent fff9d6af
...@@ -35,9 +35,14 @@ class ApiKeyHeaderPermission(permissions.BasePermission): ...@@ -35,9 +35,14 @@ class ApiKeyHeaderPermission(permissions.BasePermission):
return False return False
# The client needs to present the same api key # The client needs to present the same api key
header_key = request.META['headers'].get('X-Edx-Api-Key') header_key = request.META.get('HTTP_X_EDX_API_KEY')
if header_key is None: if header_key is None:
return False try:
header_key = request.META['headers'].get('X-Edx-Api-Key')
if header_key is None:
return False
except KeyError:
return False
# The api key values need to be the same # The api key values need to be the same
if header_key != api_key: if header_key != api_key:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment