From f44584f1319706d2e03fa2fa1563ddcd1c19249e Mon Sep 17 00:00:00 2001 From: j Date: Fri, 12 Jan 2018 11:35:37 +0100 Subject: [PATCH] allow cross origin content-type header --- pandora/oxdjango/api/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora/oxdjango/api/views.py b/pandora/oxdjango/api/views.py index 31c71232..6d431e8a 100644 --- a/pandora/oxdjango/api/views.py +++ b/pandora/oxdjango/api/views.py @@ -17,6 +17,8 @@ def api(request): response = render_to_json_response({'status': {'code': 200, 'text': 'use POST'}}) response['Access-Control-Allow-Origin'] = '*' + response['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS' + response['Access-Control-Allow-Headers'] = 'Content-Type' return response if request.META['REQUEST_METHOD'] != "POST" or ( not 'action' in request.POST and request.META.get('CONTENT_TYPE') != 'application/json'