Permalink
Browse files

Prevent the Cookie: header being set from within the header map -- on…

…ly the cookies argument should work for this.
  • Loading branch information...
1 parent cbbf102 commit 4c32adeaa76b941790b4de3f2eda2460f77bb4a5 Richard Newman committed Jul 4, 2009
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/clojure/http/client.clj
@@ -112,10 +112,10 @@ by a server."
"GET")))]
(.setRequestMethod connection method)
- (doseq [header (conj default-headers (or headers {}))]
- (.setRequestProperty connection
- (first header)
- (second header)))
+ (doseq [[header value] (conj default-headers (or headers {}))]
+ ;; Treat Cookie specially -- see below.
+ (when (not (= header "Cookie"))
+ (.setRequestProperty connection header value)))
(when (and cookies (not (empty? cookies)))
(.setRequestProperty connection

0 comments on commit 4c32ade

Please sign in to comment.