Issue 653: Don't throw exception if response has no vary header.

This commit is contained in:
Nathan Yergler 2011-11-13 11:41:43 -08:00
parent d0504cfa87
commit b97ae0fd7d

View File

@ -98,7 +98,7 @@ class CsrfMiddleware(object):
httponly=True)
# update the Vary header
response.vary = (response.vary or []) + ['Cookie']
response.vary = getattr(response, 'vary', []) + ['Cookie']
def _make_token(self, request):
"""Generate a new token to use for CSRF protection."""