Commit c0e5d189 by tarokkk

Fixed CloudStore @force_ssl decorator NameError: global name 'args' is not defined

parent ffaa2c05
......@@ -32,15 +32,15 @@ except:
def force_ssl(original_function):
def new_function(*args, **kwargs):
ssl = request.environ.get('SSL_CLIENT_VERIFY', 'NONE')
if ssl != "SUCCESS":
abort(403, "Forbidden requests. This site need SSL verification! SSL status: "+ssl)
if FORCE_SSL:
ssl = request.environ.get('SSL_CLIENT_VERIFY', 'NONE')
if ssl != "SUCCESS":
abort(403, "Forbidden requests. This site need SSL verification! SSL status: "+ssl)
else:
return original_function(*args, **kwargs)
else:
return original_function(*args, **kwargs)
if FORCE_SSL:
return new_function
else:
return original_function(*args, **kwargs)
return new_function
@route('/')
@force_ssl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment