Commit c0e5d189 by tarokkk

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

parent ffaa2c05
...@@ -32,15 +32,15 @@ except: ...@@ -32,15 +32,15 @@ except:
def force_ssl(original_function): def force_ssl(original_function):
def new_function(*args, **kwargs): def new_function(*args, **kwargs):
if FORCE_SSL:
ssl = request.environ.get('SSL_CLIENT_VERIFY', 'NONE') ssl = request.environ.get('SSL_CLIENT_VERIFY', 'NONE')
if ssl != "SUCCESS": if ssl != "SUCCESS":
abort(403, "Forbidden requests. This site need SSL verification! SSL status: "+ssl) abort(403, "Forbidden requests. This site need SSL verification! SSL status: "+ssl)
else: else:
return original_function(*args, **kwargs) return original_function(*args, **kwargs)
if FORCE_SSL:
return new_function
else: else:
return original_function(*args, **kwargs) return original_function(*args, **kwargs)
return new_function
@route('/') @route('/')
@force_ssl @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