Skip to content
Browse files

merge parse-url map into redirect request

  • Loading branch information...
1 parent c05a2ea commit 331ababb6a5ff0d627a22c876cdee9f8dd420ca2 @dakrone committed May 2, 2013
Showing with 5 additions and 2 deletions.
  1. +2 −0 changelog.org
  2. +3 −2 src/clj_http/client.clj
View
2 changelog.org
@@ -289,6 +289,8 @@
** 2013-05-02
- merged https://github.com/dakrone/clj-http/pull/138 to preserve
http method for 307 redirect
+ - merged in parse-url parameters into follow-redirect so request
+ map is not inconsistent
** 2013-05-01
- bumped http* deps to 4.2.5
** 2013-04-25
View
5 src/clj_http/client.clj
@@ -143,9 +143,10 @@
raw-redirect (get-in resp [:headers "location"])
redirect (str (URL. (URL. url) raw-redirect))]
((wrap-redirects client) (-> req
+ (merge (parse-url redirect))
(dissoc :query-params)
- (assoc :url redirect
- :trace-redirects trace-redirects)))))
+ (assoc :url redirect)
+ (assoc :trace-redirects trace-redirects)))))
(defn wrap-redirects
"Middleware that follows redirects in the response. A slingshot exception is

0 comments on commit 331abab

Please sign in to comment.
Something went wrong with that request. Please try again.