Merge "Simplify use of secure_proxy_ssl_header"

This commit is contained in:
Jenkins 2016-03-02 17:08:31 +00:00 committed by Gerrit Code Review
commit b2b75412f1
2 changed files with 2 additions and 3 deletions

View File

@ -133,7 +133,7 @@ FILE_OPTIONS = {
'with an HTTP 403 Forbidden error. If set to false, '
'passwords are automatically truncated to the '
'maximum length.'),
cfg.StrOpt('secure_proxy_ssl_header', default="HTTP_X_FORWARDED_PROTO",
cfg.StrOpt('secure_proxy_ssl_header', default='HTTP_X_FORWARDED_PROTO',
help='The HTTP header used to determine the scheme for the '
'original request, even if it was removed by an SSL '
'terminating proxy.'),

View File

@ -210,8 +210,7 @@ class Application(BaseApplication):
context['headers'] = dict(req.headers.items())
context['path'] = req.environ['PATH_INFO']
scheme = (None if not CONF.secure_proxy_ssl_header
else req.environ.get(CONF.secure_proxy_ssl_header))
scheme = req.environ.get(CONF.secure_proxy_ssl_header)
if scheme:
# NOTE(andrey-mp): "wsgi.url_scheme" contains the protocol used
# before the proxy removed it ('https' usually). So if