cors: update default configuration

Set_defaults has been added into oslo_middleware. So we use it to
override the configuration defaults.

Change-Id: Ic9c6278e43a66da9f94f556430944fe9b42fb1b7
This commit is contained in:
xpress 2016-11-05 22:22:01 +05:30 committed by Rico Lin
parent 8ca06cfeaf
commit 98242af148
1 changed files with 18 additions and 20 deletions

View File

@ -540,23 +540,21 @@ def get_ssl_options(client):
def set_config_defaults():
"""This method updates all configuration default values."""
# CORS Defaults
# TODO(krotscheck): Update with https://review.openstack.org/#/c/285368/
cfg.set_defaults(cors.CORS_OPTS,
allow_headers=['X-Auth-Token',
'X-Identity-Status',
'X-Roles',
'X-Service-Catalog',
'X-User-Id',
'X-Tenant-Id',
'X-OpenStack-Request-ID'],
expose_headers=['X-Auth-Token',
'X-Subject-Token',
'X-Service-Token',
'X-OpenStack-Request-ID'],
allow_methods=['GET',
'PUT',
'POST',
'DELETE',
'PATCH']
)
cors.set_defaults(
allow_headers=['X-Auth-Token',
'X-Identity-Status',
'X-Roles',
'X-Service-Catalog',
'X-User-Id',
'X-Tenant-Id',
'X-OpenStack-Request-ID'],
expose_headers=['X-Auth-Token',
'X-Subject-Token',
'X-Service-Token',
'X-OpenStack-Request-ID'],
allow_methods=['GET',
'PUT',
'POST',
'DELETE',
'PATCH']
)