From 3ca24f58388dc0d9ec1406e052a66fbdd982079b Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sun, 20 Apr 2014 12:24:13 +0200 Subject: [PATCH] Quick hack to prevent django from adding vary:cookie on proxy view --- umap/tests/test_views.py | 1 + umap/views.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/umap/tests/test_views.py b/umap/tests/test_views.py index 179f6992..4f7933de 100644 --- a/umap/tests/test_views.py +++ b/umap/tests/test_views.py @@ -68,3 +68,4 @@ class TestsProxy(TestCase): response = self.client.get(url, params, **headers) self.assertEquals(response.status_code, 200) self.assertIn('Example Domain', response.content) + self.assertNotIn("Cookie", response['Vary']) diff --git a/umap/views.py b/umap/views.py index 1c93ad0d..9013fdb4 100644 --- a/umap/views.py +++ b/umap/views.py @@ -229,5 +229,7 @@ class AjaxProxy(View): status_code = proxied_request.code mimetype = proxied_request.headers.typeheader or mimetypes.guess_type(url) content = proxied_request.read() + # Quick hack to prevent Django from adding a Vary: Cookie header + self.request.session.accessed = False return HttpResponse(content, status=status_code, mimetype=mimetype) ajax_proxy = AjaxProxy.as_view()