Add X-Openstack-Request-Id to Access-Control-Expose-Headers
Change-Id: Ib95a693042f0b3cf204033eb5957660cb3573dcf Related-Change: I56cd4738808b99c0a08463f83c100be51a62db05
This commit is contained in:
parent
40152f4242
commit
e8a5448b07
@ -398,7 +398,8 @@ X-Container-Meta-Access-Control-Expose-Headers:
|
|||||||
- All “simple response headers” as listed on
|
- All “simple response headers” as listed on
|
||||||
`http://www.w3.org/TR/cors/#simple-response-header
|
`http://www.w3.org/TR/cors/#simple-response-header
|
||||||
<http://www.w3.org/TR/cors/#simple-response-header>`_.
|
<http://www.w3.org/TR/cors/#simple-response-header>`_.
|
||||||
- The headers ``etag``, ``x-timestamp``, ``x-trans-id``.
|
- The headers ``etag``, ``x-timestamp``, ``x-trans-id``,
|
||||||
|
``x-openstack-request-id``.
|
||||||
- All metadata headers (``X-Container-Meta-*`` for containers and
|
- All metadata headers (``X-Container-Meta-*`` for containers and
|
||||||
``X-Object-Meta-*`` for objects).
|
``X-Object-Meta-*`` for objects).
|
||||||
- headers listed in ``X-Container-Meta-Access-Control-Expose-Headers``.
|
- headers listed in ``X-Container-Meta-Access-Control-Expose-Headers``.
|
||||||
|
@ -43,7 +43,8 @@ returns the following values for this header,
|
|||||||
|
|
||||||
* "simple response headers" as listed on
|
* "simple response headers" as listed on
|
||||||
http://www.w3.org/TR/cors/#simple-response-header
|
http://www.w3.org/TR/cors/#simple-response-header
|
||||||
* the headers ``etag``, ``x-timestamp``, ``x-trans-id``
|
* the headers ``etag``, ``x-timestamp``, ``x-trans-id``,
|
||||||
|
``x-openstack-request-id``
|
||||||
* all metadata headers (``X-Container-Meta-*`` for containers and
|
* all metadata headers (``X-Container-Meta-*`` for containers and
|
||||||
``X-Object-Meta-*`` for objects)
|
``X-Object-Meta-*`` for objects)
|
||||||
* headers listed in ``X-Container-Meta-Access-Control-Expose-Headers``
|
* headers listed in ``X-Container-Meta-Access-Control-Expose-Headers``
|
||||||
|
@ -239,7 +239,7 @@ def cors_validation(func):
|
|||||||
expose_headers = set([
|
expose_headers = set([
|
||||||
'cache-control', 'content-language', 'content-type',
|
'cache-control', 'content-language', 'content-type',
|
||||||
'expires', 'last-modified', 'pragma', 'etag',
|
'expires', 'last-modified', 'pragma', 'etag',
|
||||||
'x-timestamp', 'x-trans-id'])
|
'x-timestamp', 'x-trans-id', 'x-openstack-request-id'])
|
||||||
for header in resp.headers:
|
for header in resp.headers:
|
||||||
if header.startswith('X-Container-Meta') or \
|
if header.startswith('X-Container-Meta') or \
|
||||||
header.startswith('X-Object-Meta'):
|
header.startswith('X-Object-Meta'):
|
||||||
|
@ -5221,11 +5221,11 @@ class TestObjectController(unittest.TestCase):
|
|||||||
exposed = set(
|
exposed = set(
|
||||||
h.strip() for h in
|
h.strip() for h in
|
||||||
resp.headers['access-control-expose-headers'].split(','))
|
resp.headers['access-control-expose-headers'].split(','))
|
||||||
expected_exposed = set(['cache-control', 'content-language',
|
expected_exposed = set([
|
||||||
'content-type', 'expires', 'last-modified',
|
'cache-control', 'content-language', 'content-type', 'expires',
|
||||||
'pragma', 'etag', 'x-timestamp',
|
'last-modified', 'pragma', 'etag', 'x-timestamp', 'x-trans-id',
|
||||||
'x-trans-id', 'x-object-meta-color',
|
'x-openstack-request-id', 'x-object-meta-color',
|
||||||
'x-object-meta-color-ex'])
|
'x-object-meta-color-ex'])
|
||||||
self.assertEqual(expected_exposed, exposed)
|
self.assertEqual(expected_exposed, exposed)
|
||||||
|
|
||||||
# test allow_origin *
|
# test allow_origin *
|
||||||
@ -5272,10 +5272,10 @@ class TestObjectController(unittest.TestCase):
|
|||||||
exposed = set(
|
exposed = set(
|
||||||
h.strip() for h in
|
h.strip() for h in
|
||||||
resp.headers['access-control-expose-headers'].split(','))
|
resp.headers['access-control-expose-headers'].split(','))
|
||||||
expected_exposed = set(['cache-control', 'content-language',
|
expected_exposed = set([
|
||||||
'content-type', 'expires', 'last-modified',
|
'cache-control', 'content-language', 'content-type', 'expires',
|
||||||
'pragma', 'etag', 'x-timestamp',
|
'last-modified', 'pragma', 'etag', 'x-timestamp', 'x-trans-id',
|
||||||
'x-trans-id', 'x-object-meta-color'])
|
'x-openstack-request-id', 'x-object-meta-color'])
|
||||||
self.assertEqual(expected_exposed, exposed)
|
self.assertEqual(expected_exposed, exposed)
|
||||||
|
|
||||||
# test allow_origin empty
|
# test allow_origin empty
|
||||||
@ -7534,10 +7534,10 @@ class TestContainerController(unittest.TestCase):
|
|||||||
exposed = set(
|
exposed = set(
|
||||||
h.strip() for h in
|
h.strip() for h in
|
||||||
resp.headers['access-control-expose-headers'].split(','))
|
resp.headers['access-control-expose-headers'].split(','))
|
||||||
expected_exposed = set(['cache-control', 'content-language',
|
expected_exposed = set([
|
||||||
'content-type', 'expires', 'last-modified',
|
'cache-control', 'content-language', 'content-type', 'expires',
|
||||||
'pragma', 'etag', 'x-timestamp',
|
'last-modified', 'pragma', 'etag', 'x-timestamp', 'x-trans-id',
|
||||||
'x-trans-id', 'x-container-meta-color'])
|
'x-openstack-request-id', 'x-container-meta-color'])
|
||||||
self.assertEqual(expected_exposed, exposed)
|
self.assertEqual(expected_exposed, exposed)
|
||||||
|
|
||||||
def _gather_x_account_headers(self, controller_call, req, *connect_args,
|
def _gather_x_account_headers(self, controller_call, req, *connect_args,
|
||||||
|
Loading…
Reference in New Issue
Block a user