mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-25 13:47:27 +00:00
Fix CORS tests without Origin headers
According to the CORS spec 6.1.1 [1] requests without an Origin header should not return any access-control-* headers. But the current test method expects these headers to be always present in the response. Fix this by defaulting to None if the header is not present. [1] https://www.w3.org/TR/cors/#resource-requests
This commit is contained in:
parent
425d2cd698
commit
4b553b448a
1 changed files with 2 additions and 2 deletions
|
@ -5760,8 +5760,8 @@ def _cors_request_and_check(func, url, headers, expect_status, expect_allow_orig
|
||||||
r = func(url, headers=headers)
|
r = func(url, headers=headers)
|
||||||
eq(r.status_code, expect_status)
|
eq(r.status_code, expect_status)
|
||||||
|
|
||||||
assert r.headers['access-control-allow-origin'] == expect_allow_origin
|
assert r.headers.get('access-control-allow-origin', None) == expect_allow_origin
|
||||||
assert r.headers['access-control-allow-methods'] == expect_allow_methods
|
assert r.headers.get('access-control-allow-methods', None) == expect_allow_methods
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue