If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!

Put this into the model:

def requires_https():
    def wrapper(func):
        if request.function == func.__name__ and not request.is_https:
            return request.requires_https()
    return wrapper

And then in the controller:

@requires_https()
def secret():
    return locals()

 

Related slices

Comments (0)


Hosting graciously provided by:
Python Anywhere