Skip to content

Commit

Permalink
🐛 fix(handler.clj): remove unnecessary println statement
Browse files Browse the repository at this point in the history
🐛 fix(handler.clj): update destructuring keys to match context variable names
🐛 fix(mime_type.clj): change if-let to when-let for file extension check
  • Loading branch information
ccfontes committed Aug 30, 2023
1 parent 6800c0a commit bf7670f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion examples/http/bb-hello/handler.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(ns function.handler)

(defn handler [{:keys [body]}]
(println "Hello, " body)
{:body (str "Hello, " body)})
4 changes: 2 additions & 2 deletions examples/http/bb-map-context/handler.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns function.handler)

(defn handler [{:keys [body headers env]}]
[(keys body) (vals body) (:content-type headers) (:upstream-url env)])
(defn handler [{:keys [body headers context]}]
[(keys body) (vals body) (:content-type headers) (:upstream-url context)])
2 changes: 1 addition & 1 deletion template/bb/lib/ring/util/mime_type.clj
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
(defn- filename-ext
"Returns the file extension of a filename or filepath."
[filename]
(if-let [ext (second (re-find #"\.([^./\\]+)$" filename))]
(when-let [ext (second (re-find #"\.([^./\\]+)$" filename))]
(str/lower-case ext)))

(defn ext-mime-type
Expand Down

0 comments on commit bf7670f

Please sign in to comment.