https://github.com/druids/ring-headers-formatter
A Ring's middleware converts headers into Title-Case and returns keys/values as strings
https://github.com/druids/ring-headers-formatter
Last synced: 5 days ago
JSON representation
A Ring's middleware converts headers into Title-Case and returns keys/values as strings
- Host: GitHub
- URL: https://github.com/druids/ring-headers-formatter
- Owner: druids
- License: mit
- Created: 2018-01-04T09:58:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-05T10:14:09.000Z (over 8 years ago)
- Last Synced: 2025-01-30T02:14:11.875Z (over 1 year ago)
- Language: Clojure
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
ring-headers-formatter
======================
A Ring's middleware that converts response's headers into Title-Case and make sure that keys and values are strings."
[](https://circleci.com/gh/druids/ring-headers-formatter)
[](https://jarkeeper.com/druids/ring-headers-formatter)
[](https://opensource.org/licenses/MIT)
Leiningen/Boot
--------------
```clojure
[ring-headers-formatter "0.1.2"]
```
Documentation
-------------
Wrap your handlers into `wrap-response-headers`.
```clojure
(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:
```clojure
{: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.
Contribution
------------
### Conventions
* Please follow coding style defined by [`.editorconfig`](http://editorconfig.org)
and [The Clojure Style Guide](https://github.com/bbatsov/clojure-style-guide)
* Write [good commit messages](https://chris.beams.io/posts/git-commit/)
and provide an issue ID in a commit message prefixed by `#`