diff --git a/.ebextensions/nginx/conf.d/elasticbeanstalk/subfiles/iiif-website.conf b/.ebextensions/nginx/conf.d/elasticbeanstalk/subfiles/iiif-website.conf index 3160be9..29529e3 100644 --- a/.ebextensions/nginx/conf.d/elasticbeanstalk/subfiles/iiif-website.conf +++ b/.ebextensions/nginx/conf.d/elasticbeanstalk/subfiles/iiif-website.conf @@ -1,8 +1,10 @@ proxy_set_header Authorization ''; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; +proxy_hide_header Access-Control-Request-Method; +proxy_set_header Access-Control-Request-Method GET; proxy_hide_header x-amz-id-2; proxy_hide_header x-amz-request-id; proxy_intercept_errors on; proxy_pass http://iiif-website.s3-website-us-east-1.amazonaws.com; -proxy_hide_header 'Access-Control-Allow-Origin'; +proxy_hide_header 'Access-Control-Allow-Origin'; \ No newline at end of file diff --git a/tests/TestCORS.py b/tests/TestCORS.py index 14d4332..d81761d 100644 --- a/tests/TestCORS.py +++ b/tests/TestCORS.py @@ -15,8 +15,7 @@ def test_options_cors(self): "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br", "Connection": "keep-alive", - "User-Agent": "HTTPie/3.2.1", - "Access-Control-Request-Method": "GET" + "User-Agent": "HTTPie/3.2.1" } response = requests.options(url, allow_redirects=False, headers=headers)