Skip to content

Commit 834ec8a

Browse files
committed
Handle user defined tagged literals when parsing application/edn.
Users can define their own tagged literals via data_readers.clj or associng them to *data-readers*. This map has to be passed into clojure.edn/read-string or clojure.tools.reader.edn/read-string as the first argument. Otherwise they won't get recognized and an exception is thrown. With this change edn/read-string has the same behaviour as core/read-string minus the security problems.
1 parent 9dd3e1b commit 834ec8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/clj_http/client.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
[& args]
4343
{:pre [edn-enabled?]}
4444
(apply (ns-resolve (symbol "clojure.tools.reader.edn")
45-
(symbol "read-string")) args))
45+
(symbol "read-string"))
46+
{:readers @(resolve '*data-readers*)} args))
4647

4748
(defn ^:dynamic parse-html
4849
"Resolve and apply crouton's HTML parsing."

0 commit comments

Comments
 (0)