Actually, HTTP headers are case-insensitive, so you can't really trust
a regular map of keywords for all purposes. You'd have to reify a
maplike construct (maybe a clojure.lang.IAssociative?) to take care of
case differences. No idea if ring or compojure does this already yet.
I don't see why you'd preserve case when keywordifying headers. After
all, they're case-insensitive.
I believe the stable versions of Compojure/Ring downcase all headers
before keywordifying.
The bleeding-edge Ring gives you options: the httpcore adapter does
this:
headers (reduce
(fn [header-map #^Header header]
(assoc header-map
(-> header .getName lower-case)
(.getValue header)))
{} (seq (.getAllHeaders request)))
giving you a lower-case string map. You can also use Jetty, which I
believe does things case-insensitively.
There is IIRC middleware to do keywordifying.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en