Issue 653: Don't throw exception if response has no vary header.
This commit is contained in:
parent
d0504cfa87
commit
b97ae0fd7d
@ -98,7 +98,7 @@ class CsrfMiddleware(object):
|
|||||||
httponly=True)
|
httponly=True)
|
||||||
|
|
||||||
# update the Vary header
|
# update the Vary header
|
||||||
response.vary = (response.vary or []) + ['Cookie']
|
response.vary = getattr(response, 'vary', []) + ['Cookie']
|
||||||
|
|
||||||
def _make_token(self, request):
|
def _make_token(self, request):
|
||||||
"""Generate a new token to use for CSRF protection."""
|
"""Generate a new token to use for CSRF protection."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user