add X-Requested-With Vary header to sidebar views
This commit is contained in:
parent
6e9d2424f8
commit
9dafd3f777
1 changed files with 3 additions and 0 deletions
|
@ -2,6 +2,7 @@ from functools import wraps
|
|||
|
||||
from django.http import HttpResponseNotModified, HttpResponseRedirect
|
||||
from django.shortcuts import render
|
||||
from django.utils.cache import patch_vary_headers
|
||||
|
||||
from c3nav.editor.models import ChangeSet
|
||||
from c3nav.mapdata.models.access import AccessPermission
|
||||
|
@ -29,11 +30,13 @@ def sidebar_view(func=None, select_related=None):
|
|||
if not isinstance(response, HttpResponseNotModified):
|
||||
response.write(render(request, 'editor/fragment_nav.html', {}).content)
|
||||
response['Cache-Control'] = 'no-cache'
|
||||
patch_vary_headers(response, 'X-Requested-With')
|
||||
return response
|
||||
if isinstance(response, HttpResponseRedirect):
|
||||
return response
|
||||
response = render(request, 'editor/map.html', {'content': response.content})
|
||||
response['Cache-Control'] = 'no-cache'
|
||||
patch_vary_headers(response, 'X-Requested-With')
|
||||
return response
|
||||
|
||||
return with_ajax_check
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue