From: Nathan Yergler Date: Sun, 13 Nov 2011 19:41:43 +0000 (-0800) Subject: Issue 653: Don't throw exception if response has no vary header. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b97ae0fd7da45c32897a4cb8437c04ddf04fdc95;p=mediagoblin.git Issue 653: Don't throw exception if response has no vary header. --- diff --git a/mediagoblin/middleware/csrf.py b/mediagoblin/middleware/csrf.py index 7a5e352e..6c977f21 100644 --- a/mediagoblin/middleware/csrf.py +++ b/mediagoblin/middleware/csrf.py @@ -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."""