cors: update default configuration in config

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

Change-Id: I4339b3f41a5f9db187fef544f1000167c0b9b9af
This commit is contained in:
lilintan 2016-11-03 11:00:21 +08:00
parent 3aca4f312c
commit 04374fcb53
1 changed files with 16 additions and 19 deletions

View File

@ -12,28 +12,25 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from oslo_middleware import cors
def set_defaults():
"""Override all default values from upstream packages"""
# CORS Middleware Defaults
# TODO(krotscheck): Update with https://review.openstack.org/#/c/285368/
cfg.set_defaults(cors.CORS_OPTS,
allow_headers=['X-Auth-Token',
'X-Auth-Sudo-Tenant-ID',
'X-Auth-Sudo-Project-ID',
'X-Auth-All-Projects',
'X-Designate-Edit-Managed-Records',
'OpenStack-DNS-Hide-Counts'],
expose_headers=['X-OpenStack-Request-ID',
'Host'],
allow_methods=['GET',
'PUT',
'POST',
'DELETE',
'PATCH',
'HEAD']
)
cors.set_defaults(
allow_headers=['X-Auth-Token',
'X-Auth-Sudo-Tenant-ID',
'X-Auth-Sudo-Project-ID',
'X-Auth-All-Projects',
'X-Designate-Edit-Managed-Records',
'OpenStack-DNS-Hide-Counts'],
expose_headers=['X-OpenStack-Request-ID',
'Host'],
allow_methods=['GET',
'PUT',
'POST',
'DELETE',
'PATCH',
'HEAD']
)