noir-clojure / lib-noir

A set of libraries for ring apps, including stateful sessions.
Eclipse Public License 1.0
483 stars 47 forks source link

cookie names can't contain slashes #89

Closed trevor closed 10 years ago

trevor commented 10 years ago

in cookies.clj name is being used to stringify keywords, but the downside is that it's incompatible with slashes.

yogthos commented 10 years ago

You can just pass a string key with whatever value you want, eg:

(put! "foo/bar\baz" v)
trevor commented 10 years ago

I suppose it depends on if you mean to enforce namespace semantics, the tradeoff being reduced parity between keywords and strings.

(name "a/b/c/d")
;=> "a/b/c/d"

(name :a/b/c/d)
;=> "d"

(defn k->s [k] (subs (str k) 1))
(k->s :a/b/c/d)
;=> "a/b/c/d"
yogthos commented 10 years ago

I'm not opposed to using k->s internally if you'd like to make a pull request for it. :)

trevor commented 10 years ago

:) I'll put something together, thanks.