Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/common/middleware/cross_domain_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def process_request(self, request):
def process_response(self, request, response):
auth = request.META.get('HTTP_AUTHORIZATION')
origin = request.META.get('HTTP_ORIGIN')
if auth is not None and str(auth).startswith("Bearer application-") and origin is not None:

if auth is not None and any([str(auth).startswith(prefix) for prefix in
['Bearer application-', 'Bearer agent-']]) and origin is not None:
application_api_key = get_application_api_key(str(auth), True)
cross_domain_list = application_api_key.get('cross_domain_list', [])
allow_cross_domain = application_api_key.get('allow_cross_domain', False)
Expand Down