Skip to content

Commit

Permalink
[Fixes #9042] Disable caching header in GeoNode proxy for the REST API (
Browse files Browse the repository at this point in the history
#9051) (#9052)

Co-authored-by: Alessio Fabiani <[email protected]>
  • Loading branch information
github-actions[bot] and Alessio Fabiani authored Apr 6, 2022
1 parent 740b94b commit 232426b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions geonode/geoserver/tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1265,5 +1265,4 @@ def test_set_resources_links(self):
def test_gs_proxy_never_caches(self):
url = reverse('gs_styles')
response = self.client.get(url)
self.assertTrue(response.has_header('Cache-Control'))
self.assertEqual(response.headers.get('Cache-Control'), 'max-age=0, no-cache, no-store, must-revalidate, private')
self.assertFalse(response.has_header('Cache-Control'))
2 changes: 0 additions & 2 deletions geonode/geoserver/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
_invalidate_geowebcache_layer)

from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.cache import never_cache

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -469,7 +468,6 @@ def strip_prefix(path, prefix):


@csrf_exempt
@never_cache
def geoserver_proxy(request,
proxy_path,
downstream_path,
Expand Down

0 comments on commit 232426b

Please sign in to comment.