A Ring's middleware that converts response's headers into Title-Case and make sure that keys and values are strings."
[ring-headers-formatter "0.1.2"]
Wrap your handlers into wrap-response-headers
.
(require '[ring-headers-formatter.core :refer [wrap-response-headers]]
'[ring.util.response :refer [response]])
(defn handler [request]
{:response {:foo "bar"}, :headers {:x-limit 100}})
(def app
(wrap-response-headers handler))
And response's headers will be formatted like this:
{:response {:foo "bar"}, :headers {"X-Limit" "100"}}
Please notice that lazy sequences in values aren't converted into strings, rather they passed as they are.
- Please follow coding style defined by
.editorconfig
and The Clojure Style Guide - Write good commit messages
and provide an issue ID in a commit message prefixed by
#