I want to set all of my http headers responses to something like this:
response.headers[\"X-Frame-Options\"] = \"SAMEORIGIN\"
I checked thi
Set the header in a @app.after_request() hook, at which point you have a response object to set the header on:
@app.after_request
def apply_caching(response):
response.headers["X-Frame-Options"] = "SAMEORIGIN"
return response
The flask.request context is still available when this hook runs, so you can still vary the response based on the request at this time.