improved ssl-check
This commit is contained in:
parent
3e1bfda98e
commit
b16c0937f9
1 changed files with 7 additions and 12 deletions
|
@ -408,18 +408,13 @@ class WebInterfaceSites:
|
|||
if cherrypy.request.scheme == "https":
|
||||
return True
|
||||
## check an environment setting - this is quite common behind proxies
|
||||
try:
|
||||
if os.environ["HTTPS"]:
|
||||
return True
|
||||
except KeyError:
|
||||
## check http header for ssl information
|
||||
#TODO: (check pound for the name)
|
||||
try:
|
||||
if cherrypy.request.headers["XXX"]:
|
||||
return True
|
||||
except KeyError:
|
||||
## the connection seems to be unencrypted
|
||||
return False
|
||||
if os.environ.has_key("HTTPS"):
|
||||
return True
|
||||
## this arbitrarily chosen header must be documented in README.proxy
|
||||
#TODO: check http://jamesthornton.com/writing/openacs-pound.html for this
|
||||
if cherrypy.request.headers.has_key("X-SSL-Request") \
|
||||
and (cherrypy.request.headers["X-SSL-Request"] == "1"):
|
||||
return True
|
||||
|
||||
|
||||
def __set_web_lang(self, value):
|
||||
|
|
Loading…
Reference in a new issue