mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-09 23:20:27 +00:00
updated preapre_flask_request to support frontend-ssl
This commit is contained in:
parent
97d551e11d
commit
805439e6ee
@ -164,13 +164,18 @@ def email_to_gravatar_url(email, size=100):
|
|||||||
return "https://s.gravatar.com/avatar/%s?s=%s" % (hash_string, size)
|
return "https://s.gravatar.com/avatar/%s?s=%s" % (hash_string, size)
|
||||||
|
|
||||||
def prepare_flask_request(request):
|
def prepare_flask_request(request):
|
||||||
|
# If server is behind proxys or balancers use the HTTP_X_FORWARDED fields
|
||||||
url_data = urlparse.urlparse(request.url)
|
url_data = urlparse.urlparse(request.url)
|
||||||
return {
|
return {
|
||||||
|
'https': 'on' if request.scheme == 'https' else 'off',
|
||||||
'http_host': request.host,
|
'http_host': request.host,
|
||||||
'server_port': url_data.port,
|
'server_port': url_data.port,
|
||||||
'script_name': request.path,
|
'script_name': request.path,
|
||||||
'get_data': request.args.copy(),
|
'get_data': request.args.copy(),
|
||||||
'post_data': request.form.copy()
|
'post_data': request.form.copy(),
|
||||||
|
# Uncomment if using ADFS as IdP, https://github.com/onelogin/python-saml/pull/144
|
||||||
|
# 'lowercase_urlencoding': True,
|
||||||
|
'query_string': request.query_string
|
||||||
}
|
}
|
||||||
|
|
||||||
def init_saml_auth(req):
|
def init_saml_auth(req):
|
||||||
|
Loading…
Reference in New Issue
Block a user