I have a flask application and I have created a custom decorator that checks some header information for permission on controllers.py
.
app.py
app = Flask(__name__)
if __name__ == "__main__":
app.run(host='0.0.0.0', port=80)
controllers.py
@route('/')
@custom_decorator
def get():
pass
@route('/id')
def get_id():
pass
On this case, see that I forgot to use my decorator on the second method. There is any way I can guarantee that If I forget my decorator a exception would be throw? In the case of a new dev in the team forget to use the decorator or something like that.
Is there any way I can do something with the request before it hit the controllers?