Issue 653: Handle the case where request.vary is None

This commit is contained in:
Nathan Yergler 2011-11-13 11:59:24 -08:00
parent b97ae0fd7d
commit ad3f1233df

View File

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