Skip to content

Commit

Permalink
Fix #46: query params are double encoded
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Feb 10, 2024
1 parent f8ac15a commit 948327d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/babashka/http_client/interceptors.clj
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@
(url-encode (str v)))) (next kvs))))
(str/join "&" (persistent! params*)))))

(defn uri-with-query [^java.net.URI uri new-query]
(defn uri-with-query
"We can't use the URI constructor because it encodes all arguments for us.
See https://stackoverflow.com/a/77971448/6264"
[^java.net.URI uri new-query]
(let [old-query (.getQuery uri)
new-query (if old-query (str old-query "&" new-query)
new-query)]
Expand Down

0 comments on commit 948327d

Please sign in to comment.