Skip to content

Commit

Permalink
cors: update default configuration in config
Browse files Browse the repository at this point in the history
Set_defaults has been added into oslo_middleware. so we use it
to override the configuration defaults.

Change-Id: I4339b3f41a5f9db187fef544f1000167c0b9b9af
  • Loading branch information
lilintan committed Nov 3, 2016
1 parent 3aca4f3 commit 04374fc
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions designate/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
)

0 comments on commit 04374fc

Please sign in to comment.