tailrecursion/ring-edn

Use the edn reader

Closed this issue · 2 comments

bensu commented

Since the incoming request can come from untrusted sources it would be more appropriate to use clojure.edn/read-string instead of clojure.core/read-string. It could also take an opts map with custom :readers, :eof, and :default, like clojure.edn/read-string does:

(wrap-edn-params handler {:readers {'my-project/tag #'my-reader}})

If it's within scope, I'll gladly submit a patch for it.

fogus commented

It's definitely within scope.

bensu commented

PR in #8

I apologize, when I proposed using clojure.edn/read-string I was looking at old source as found in crossclj. The PR was pretty straightforward since newer versions of ring-edn already use clojure.edn/read-string.