Skip to content
Snippets Groups Projects
Unverified Commit 02f26e07 authored by Cal Herries's avatar Cal Herries Committed by GitHub
Browse files

Stop caching /api/geojson/:key requests (#23474)

* Stop caching /api/geojson/:key requests

* Remove extra require
parent b6e6e07c
No related branches found
No related tags found
No related merge requests found
......@@ -37,9 +37,7 @@
(and query-string
(re-matches #"^/app/dist/.*\.(js|css)$" uri))
;; any resource that is named as a cache-busting hex string (e.g. fonts, images)
(re-matches #"^/app/dist/[a-f0-9]{20}+.*$" uri)
;; GeoJSON proxy requests should also be cached
(re-matches #"^/api/geojson/.*" uri))))
(re-matches #"^/app/dist/[a-f0-9]{20}+.*$" uri))))
(defn https?
"True if the original request made by the frontend client (i.e., browser) was made over HTTPS.
......
......@@ -4,7 +4,6 @@
[metabase.api.geojson :as api.geojson]
[metabase.http-client :as client]
[metabase.models.setting :as setting]
[metabase.server.middleware.security :as mw.security]
[metabase.test :as mt]
[metabase.util :as u]
[metabase.util.schema :as su]
......@@ -156,10 +155,6 @@
(is (= {:type "Point"
:coordinates [37.77986 -122.429]}
(mt/user-http-request :rasta :get 200 "geojson/middle-earth"))))
(testing "response should not include the usual cache-busting headers"
(is (= (#'mw.security/cache-far-future-headers)
(select-keys (:headers (client/client-full-response :get 200 "geojson/middle-earth"))
(keys (#'mw.security/cache-prevention-headers))))))
(testing "should be able to fetch the GeoJSON even if you aren't logged in"
(is (= {:type "Point"
:coordinates [37.77986 -122.429]}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment