Skip to content
Browse files

Handle undefined routes safely with a 404

  • Loading branch information...
swlkr committed Mar 15, 2019
1 parent fe3b9f1 commit c37f25c0961224672dfd669b1f96682d9396c3f2
Showing with 1 addition and 6 deletions.
  1. +1 −6 src/coast/router.clj
@@ -247,15 +247,10 @@
:message "404 uri not found"}
:headers {"content-type" "application/json"}})

(defn keyword->symbol [k]
(let [kns (namespace k)
kn (name k)]
(symbol kns kn)))

(defn resolve-route-fn [f]
(symbol? f) (resolve f)
(keyword? f) (-> f keyword->symbol resolve)
(keyword? f) (-> f utils/keyword->symbol utils/resolve-safely)
:else f))

(defn resolve-route [val]

0 comments on commit c37f25c

Please sign in to comment.
You can’t perform that action at this time.