diff --git a/src/metabase/api/routes.clj b/src/metabase/api/routes.clj index 6666faff0d948f8a0d68644c8cd15cffd968d5c0..20b4821417e8ddccefe4ff4ecbd1d2ff635080da 100644 --- a/src/metabase/api/routes.clj +++ b/src/metabase/api/routes.clj @@ -69,7 +69,7 @@ (context "/email" [] (+auth email/routes)) (context "/embed" [] (+message-only-exceptions embed/routes)) (context "/field" [] (+auth field/routes)) - (context "/geojson" [] (+auth geojson/routes)) + (context "/geojson" [] geojson/routes) (context "/ldap" [] (+auth ldap/routes)) (context "/metric" [] (+auth metric/routes)) (context "/notify" [] (+apikey notify/routes)) diff --git a/test/metabase/api/geojson_test.clj b/test/metabase/api/geojson_test.clj index 28d5f2af98ade11545ee2ac3aa711b5bf92ceccf..d7ae0dbfce46f521e1dd4f9321ab63aa474e7222 100644 --- a/test/metabase/api/geojson_test.clj +++ b/test/metabase/api/geojson_test.clj @@ -1,10 +1,12 @@ (ns metabase.api.geojson-test (:require [expectations :refer [expect]] + [metabase + [http-client :as client] + [util :as u]] [metabase.api.geojson :as geojson-api] [metabase.test.data.users :refer [user->client]] [metabase.test.util :as tu] [metabase.test.util.log :as tu.log] - [metabase.util :as u] [schema.core :as s])) (def ^:private ^String test-geojson-url @@ -104,6 +106,13 @@ (tu/with-temporary-setting-values [custom-geojson test-custom-geojson] ((user->client :rasta) :get 200 "geojson/middle-earth"))) +;; should be able to fetch the GeoJSON even if you aren't logged in +(expect + {:type "Point" + :coordinates [37.77986 -122.429]} + (tu/with-temporary-setting-values [custom-geojson test-custom-geojson] + (client/client :get 200 "geojson/middle-earth"))) + ;; try fetching an invalid key; should fail (expect "Invalid custom GeoJSON key: invalid-key"