Fix NPE in cache control decorator
This commit is contained in:
parent
a875d2c34b
commit
dd28a845db
1 changed files with 2 additions and 1 deletions
|
@ -29,6 +29,7 @@ def no_cache(f):
|
||||||
@wraps(f)
|
@wraps(f)
|
||||||
def add_no_cache(*args, **kwargs):
|
def add_no_cache(*args, **kwargs):
|
||||||
response = f(*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 response
|
||||||
return add_no_cache
|
return add_no_cache
|
||||||
|
|
Reference in a new issue