Skip to content

Commit 64412f9

Browse files
committed
Drop a "Content-Type" header, if any, for multipart requests
1 parent a9262a6 commit 64412f9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/clj_http/core.clj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,10 @@
609609
(if (string? body)
610610
(StringEntity. ^String body "UTF-8")
611611
(ByteArrayEntity. body))))))
612-
(doseq [[header-n header-v] headers]
612+
(doseq [[header-n header-v] headers
613+
:when (or (not multipart)
614+
(and (not= "content-type" header-n)
615+
(not= "Content-Type" header-n)))]
613616
(if (coll? header-v)
614617
(doseq [header-vth header-v]
615618
(.addHeader http-req header-n header-vth))

0 commit comments

Comments
 (0)