From 14d24f496e56a92d674a1f3cab2b2a5dc7db11fe Mon Sep 17 00:00:00 2001 From: Michele Comitini Date: Tue, 15 May 2012 22:38:43 +0200 Subject: [PATCH] Simplify the https check logic using request.is_https which is smarter. --- applications/welcome/controllers/appadmin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/applications/welcome/controllers/appadmin.py b/applications/welcome/controllers/appadmin.py index 7a2ce1f7..70f66878 100644 --- a/applications/welcome/controllers/appadmin.py +++ b/applications/welcome/controllers/appadmin.py @@ -25,8 +25,7 @@ try: except: hosts = (http_host, ) -if request.env.http_x_forwarded_for or request.env.wsgi_url_scheme\ - in ['https', 'HTTPS']: +if request.env.http_x_forwarded_for or request.is_https: session.secure() elif (remote_addr not in hosts) and (remote_addr != "127.0.0.1"): raise HTTP(200, T('appadmin is disabled because insecure channel'))