Issue 653: Handle the case where request.vary is None
This commit is contained in:
parent
b97ae0fd7d
commit
ad3f1233df
@ -98,7 +98,7 @@ class CsrfMiddleware(object):
|
|||||||
httponly=True)
|
httponly=True)
|
||||||
|
|
||||||
# update the Vary header
|
# update the Vary header
|
||||||
response.vary = getattr(response, 'vary', []) + ['Cookie']
|
response.vary = (getattr(response, 'vary') or []) + ['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