Merge "Simplify use of secure_proxy_ssl_header"
This commit is contained in:
commit
b2b75412f1
@ -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.'),
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user