Skip to content
Snippets Groups Projects
Unverified Commit c488057b authored by Sameer Al-Sakran's avatar Sameer Al-Sakran Committed by GitHub
Browse files

Merge pull request #7577 from metabase/fix-7549

Return generic error message for nonexistent API endpoint 404 message
parents 45a79f03 c5c5d83f
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,8 @@
[user :as user]
[util :as util]
[x-ray :as x-ray]]
[metabase.middleware :as middleware]))
[metabase.middleware :as middleware]
[puppetlabs.i18n.core :refer [tru]]))
(def ^:private +generic-exceptions
"Wrap ROUTES so any Exception thrown is just returned as a generic 400, to prevent details from leaking in public
......@@ -90,6 +91,4 @@
(context "/tiles" [] (+auth tiles/routes))
(context "/user" [] (+auth user/routes))
(context "/util" [] util/routes)
(route/not-found (fn [{:keys [request-method uri]}]
{:status 404
:body (str (.toUpperCase (name request-method)) " " uri " does not exist.")})))
(route/not-found (constantly {:status 404, :body (tru "API endpoint does not exist.")})))
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