@@ -266,7 +266,7 @@ def handler(event, context):
266
266
assert headers ["Content-Type" ] == [content_types .TEXT_HTML ]
267
267
assert headers ["Access-Control-Allow-Origin" ] == ["*" ]
268
268
assert "Access-Control-Allow-Credentials" not in headers
269
- assert headers ["Access-Control-Allow-Headers" ] == sorted (CORSConfig ._REQUIRED_HEADERS )
269
+ assert headers ["Access-Control-Allow-Headers" ] == [ "," . join ( sorted (CORSConfig ._REQUIRED_HEADERS ))]
270
270
271
271
# THEN for routes without cors flag return no cors headers
272
272
mock_event = {"path" : "/my/request" , "httpMethod" : "GET" }
@@ -483,9 +483,9 @@ def another_one():
483
483
headers = result ["multiValueHeaders" ]
484
484
assert headers ["Content-Type" ] == [content_types .APPLICATION_JSON ]
485
485
assert headers ["Access-Control-Allow-Origin" ] == [cors_config .allow_origin ]
486
- expected_allows_headers = sorted (set (allow_header + cors_config ._REQUIRED_HEADERS ))
486
+ expected_allows_headers = [ "," . join ( sorted (set (allow_header + cors_config ._REQUIRED_HEADERS )))]
487
487
assert headers ["Access-Control-Allow-Headers" ] == expected_allows_headers
488
- assert headers ["Access-Control-Expose-Headers" ] == cors_config .expose_headers
488
+ assert headers ["Access-Control-Expose-Headers" ] == [ "," . join ( cors_config .expose_headers )]
489
489
assert headers ["Access-Control-Max-Age" ] == [str (cors_config .max_age )]
490
490
assert "Access-Control-Allow-Credentials" in headers
491
491
assert headers ["Access-Control-Allow-Credentials" ] == ["true" ]
@@ -558,7 +558,7 @@ def post_no_cors():
558
558
headers = result ["multiValueHeaders" ]
559
559
assert "Content-Type" not in headers
560
560
assert "Access-Control-Allow-Origin" in result ["multiValueHeaders" ]
561
- assert headers ["Access-Control-Allow-Methods" ] == ["DELETE" , " GET" , " OPTIONS" ]
561
+ assert headers ["Access-Control-Allow-Methods" ] == ["DELETE, GET, OPTIONS" ]
562
562
563
563
564
564
def test_custom_preflight_response ():
0 commit comments