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) (#9087)

Co-authored-by: Alessio Fabiani <[email protected]>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alessio Fabiani <[email protected]>
  • Loading branch information
github-actions[bot] and Alessio Fabiani authored Apr 12, 2022
1 parent 68102b8 commit 31cd792
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 @@ -1266,5 +1266,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 @@ -82,7 +82,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 @@ -470,7 +469,6 @@ def strip_prefix(path, prefix):


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

0 comments on commit 31cd792

Please sign in to comment.