mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 14:40:27 +00:00
Use HTTP_X_FORWARDED_PROTO header from reverse proxy to rewrite https:// for SAML request URLs
This commit is contained in:
parent
9221d58a1b
commit
e4c8c3892f
@ -72,8 +72,9 @@ class SAML(object):
|
||||
def prepare_flask_request(self, request):
|
||||
# If server is behind proxys or balancers use the HTTP_X_FORWARDED fields
|
||||
url_data = urlparse(request.url)
|
||||
proto = request.headers.get('HTTP_X_FORWARDED_PROTO', request.scheme)
|
||||
return {
|
||||
'https': 'on' if request.scheme == 'https' else 'off',
|
||||
'https': 'on' if proto == 'https' else 'off',
|
||||
'http_host': request.host,
|
||||
'server_port': url_data.port,
|
||||
'script_name': request.path,
|
||||
|
Loading…
Reference in New Issue
Block a user