Use set_defaults method in oslo_middleware to check CORS_OPTS

replace the cfg.set_defaults with cors.set_defaults for check
the CORS_OPTS

Change-Id: I3faa92574a755e6cc410c69e0e673abad93e6315
This commit is contained in:
zhangshengping2012 2016-10-26 16:45:00 +08:00
parent 98d37b92c1
commit 79b4bf3927
1 changed files with 18 additions and 21 deletions

View File

@ -12,29 +12,26 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from oslo_middleware import cors
def set_cors_middleware_defaults():
"""Update default configuration options for oslo.middleware."""
# 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']
)