Fix NPE in cache control decorator

This commit is contained in:
Joseph Schorr 2015-05-28 13:22:42 -04:00
parent a875d2c34b
commit dd28a845db

View file

@ -29,6 +29,7 @@ def no_cache(f):
@wraps(f)
def add_no_cache(*args, **kwargs):
response = f(*args, **kwargs)
response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
if response is not None:
response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
return response
return add_no_cache