Always send responses to POST requests with Cache-Control: no-cache

This commit is contained in:
Gina Häußge 2015-01-29 16:36:08 +01:00
parent f4df354cd0
commit 151864f1d4

View file

@ -89,6 +89,13 @@ LANGUAGES = get_available_locale_identifiers(LOCALES)
def before_request():
g.locale = get_locale()
@app.after_request
def after_request(response):
# send no-cache headers with all POST responses
if request.method == "POST":
response.cache_control.no_cache = True
return response
@babel.localeselector
def get_locale():