From cda5fdf78bc8d5283df3e01d4c13743b132997af Mon Sep 17 00:00:00 2001 From: Lou Wolford Date: Mon, 21 Mar 2016 15:51:12 -0400 Subject: [PATCH] Update AllowOriginMiddleware.py --- adl_lrs/utils/AllowOriginMiddleware.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/adl_lrs/utils/AllowOriginMiddleware.py b/adl_lrs/utils/AllowOriginMiddleware.py index e6e1be5b..38995ff4 100644 --- a/adl_lrs/utils/AllowOriginMiddleware.py +++ b/adl_lrs/utils/AllowOriginMiddleware.py @@ -6,13 +6,7 @@ def process_request(self, request): return HttpResponse() def process_response(self, request, response): - protocol = 'https' if request.is_secure() else 'http' - port = None - if 'SERVER_PORT' in request.META: - port = request.META['SERVER_PORT'] - response['Access-Control-Allow-Origin'] = "%s://%s:%s" % (protocol, request.META['SERVER_NAME'], port) - else: - response['Access-Control-Allow-Origin'] = "%s://%s" % (protocol, request.META['SERVER_NAME']) + response['Access-Control-Allow-Origin'] = '*' response['Access-Control-Allow-Methods'] = 'HEAD, POST, GET, OPTIONS, DELETE, PUT' response['Access-Control-Allow-Headers'] = 'Content-Type,Content-Length,Authorization,If-Match,If-None-Match,X-Experience-API-Version, Accept-Language' response['Access-Control-Expose-Headers'] = 'ETag,Last-Modified,Cache-Control,Content-Type,Content-Length,WWW-Authenticate,X-Experience-API-Version, Accept-Language'