Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix generate-query-string to handle sequential values properly.

  • Loading branch information...
commit da9780506f5137bd8aeaefbe71ca0ed8e0403caa 1 parent 95d8e81
@ghoseb authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/clj_http/client.clj
View
14 src/clj_http/client.clj
@@ -126,9 +126,17 @@
(defn generate-query-string [params]
(str/join "&"
- (map (fn [[k v]] (str (util/url-encode (name k)) "="
- (util/url-encode (str v))))
- params)))
+ (mapcat (fn [[k v]]
+ (if (sequential? v)
+ (map #(str (util/url-encode (name %1))
+ "="
+ (util/url-encode (str %2)))
+ (repeat k) v)
+ [(str (util/url-encode (name k))
+ "="
+ (util/url-encode (str v)))]))
+ params)))
+
(defn wrap-query-params [client]
(fn [{:keys [query-params] :as req}]
Please sign in to comment.
Something went wrong with that request. Please try again.