Skip to content

Commit 4c32ade

Browse files
Richard NewmanRichard Newman
authored andcommitted
Prevent the Cookie: header being set from within the header map -- only the cookies argument should work for this.
1 parent cbbf102 commit 4c32ade

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/clojure/http/client.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ by a server."
112112
"GET")))]
113113
(.setRequestMethod connection method)
114114

115-
(doseq [header (conj default-headers (or headers {}))]
116-
(.setRequestProperty connection
117-
(first header)
118-
(second header)))
115+
(doseq [[header value] (conj default-headers (or headers {}))]
116+
;; Treat Cookie specially -- see below.
117+
(when (not (= header "Cookie"))
118+
(.setRequestProperty connection header value)))
119119

120120
(when (and cookies (not (empty? cookies)))
121121
(.setRequestProperty connection

0 commit comments

Comments
 (0)