summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Krotscheck <krotscheck@gmail.com>2015-08-12 12:40:58 -0700
committerMichael Krotscheck <krotscheck@gmail.com>2015-08-12 12:40:58 -0700
commit1441de4a1ad37823d53f0b11de7fb009b8756392 (patch)
tree33b3d56b9b49b6ac7fc74c13c6717edbad1ad043
parent3fbb59574ca3bceb42baa0847d146f471145ab31 (diff)
downloadoslo-middleware-1441de4a1ad37823d53f0b11de7fb009b8756392.tar.gz
Renamed latent_configuration to _latent_configuration.
This hash is private, this patch marks it as such. Change-Id: Ia334f18b7db847c6b2cbb98a6462744530ed59ad
-rw-r--r--oslo_middleware/cors.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/oslo_middleware/cors.py b/oslo_middleware/cors.py
index 1b22178..69c23cf 100644
--- a/oslo_middleware/cors.py
+++ b/oslo_middleware/cors.py
@@ -22,7 +22,6 @@ import webob.dec
import webob.exc
import webob.response
-
LOG = logging.getLogger(__name__)
CORS_OPTS = [
@@ -99,7 +98,7 @@ class CORS(base.Middleware):
'''Initialize this middleware from an oslo.config instance.'''
# Set up a location for our latent configuration options
- self.latent_configuration = {
+ self._latent_configuration = {
'allow_headers': [],
'expose_headers': [],
'methods': []
@@ -188,19 +187,19 @@ class CORS(base.Middleware):
if allow_headers:
if isinstance(allow_headers, list):
- self.latent_configuration['allow_headers'] = allow_headers
+ self._latent_configuration['allow_headers'] = allow_headers
else:
raise TypeError("allow_headers must be a list or None.")
if expose_headers:
if isinstance(expose_headers, list):
- self.latent_configuration['expose_headers'] = expose_headers
+ self._latent_configuration['expose_headers'] = expose_headers
else:
raise TypeError("expose_headers must be a list or None.")
if allow_methods:
if isinstance(allow_methods, list):
- self.latent_configuration['methods'] = allow_methods
+ self._latent_configuration['methods'] = allow_methods
else:
raise TypeError("allow_methods parameter must be a list or"
" None.")
@@ -290,7 +289,8 @@ class CORS(base.Middleware):
# Compare request method to permitted methods (Section 6.2.5)
permitted_methods = (
- cors_config['allow_methods'] + self.latent_configuration['methods']
+ cors_config['allow_methods'] +
+ self._latent_configuration['methods']
)
if request_method not in permitted_methods:
LOG.debug('Request method \'%s\' not in permitted list: %s'
@@ -302,7 +302,7 @@ class CORS(base.Middleware):
permitted_headers = [header.upper() for header in
(cors_config['allow_headers'] +
self.simple_headers +
- self.latent_configuration['allow_headers'])]
+ self._latent_configuration['allow_headers'])]
for requested_header in request_headers:
upper_header = requested_header.upper()
if upper_header not in permitted_headers:
@@ -364,7 +364,7 @@ class CORS(base.Middleware):
if cors_config['expose_headers']:
response.headers['Access-Control-Expose-Headers'] = \
','.join(cors_config['expose_headers'] +
- self.latent_configuration['expose_headers'])
+ self._latent_configuration['expose_headers'])
# NOTE(sileht): Shortcut for backwards compatibility
filter_factory = CORS.factory