Auth(secure=True), thanks Yarin and Niphlod

This commit is contained in:
mdipierro
2012-10-04 15:12:52 -05:00
parent deaee3f6a8
commit a9f4585a36
3 changed files with 10 additions and 4 deletions
+5 -2
View File
@@ -123,6 +123,8 @@ except:
load()
HTTPS_SCHEMES = set(('https','HTTPS'))
def get_client(env):
"""
guess the client address from the environment variables
@@ -445,8 +447,9 @@ def wsgibase(environ, responder):
ajax = x_req_with == 'xmlhttprequest',
cid = env.http_web2py_component_element,
is_local = env.remote_addr in local_hosts,
is_https = env.wsgi_url_scheme \
in ['https', 'HTTPS'] or env.https=='on')
is_https = env.wsgi_url_scheme in HTTPS_SCHEMES \
or request.env.http_x_forwarded_proto in HTTPS_SCHEMES \
or env.https=='on')
request.uuid = request.compute_uuid() # requires client
request.url = environ['PATH_INFO']