From 3f41fc53a1b692549c88a8602e753cfb887330ae Mon Sep 17 00:00:00 2001 From: Martin Klepsch Date: Mon, 23 Jul 2018 23:06:51 +0200 Subject: [PATCH 1/2] fix 17: java 9 & 20 compatibility --- src/clj_http/lite/util.clj | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/clj_http/lite/util.clj b/src/clj_http/lite/util.clj index 5906b05a..a75aa5b3 100644 --- a/src/clj_http/lite/util.clj +++ b/src/clj_http/lite/util.clj @@ -27,10 +27,15 @@ [unencoded] (URLEncoder/encode unencoded "UTF-8")) -(defn base64-encode +(defmacro base64-encode "Encode an array of bytes into a base64 encoded string." [unencoded] - (javax.xml.bind.DatatypeConverter/printBase64Binary unencoded)) + (if (try (import 'javax.xml.bind.DatatypeConverter) + (catch ClassNotFoundException _)) + `(javax.xml.bind.DatatypeConverter/printBase64Binary ~unencoded) + (do + (import 'java.util.Base64) + `(.encodeToString (java.util.Base64/getEncoder) ~unencoded)))) (defn to-byte-array "Returns a byte array for the InputStream provided." From 81c50911dcd38d582a8c39a5d2a5ac429dfeb2d5 Mon Sep 17 00:00:00 2001 From: Martin Klepsch Date: Mon, 23 Jul 2018 23:12:23 +0200 Subject: [PATCH 2/2] add deps.edn for git consumption --- deps.edn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 deps.edn diff --git a/deps.edn b/deps.edn new file mode 100644 index 00000000..2c567bea --- /dev/null +++ b/deps.edn @@ -0,0 +1,3 @@ +{:paths ["src"] + :deps {org.clojure/clojure {:mvn/version "1.6.0"} + slingshot {:mvn/version "0.12.1"}}}