We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa71753 commit 927132bCopy full SHA for 927132b
requests/test/src/requests/RequestTests.scala
@@ -301,5 +301,13 @@ object RequestTests extends TestSuite{
301
}
302
303
304
+
305
+ // Ensure when duplicate headers are passed to requests, we only pass the last one
306
+ // to the server. This preserves the 0.8.x behavior, and can always be overriden
307
+ // by passing a comma-separated list of headers instead
308
+ test("duplicateHeaders"){
309
+ val res = requests.get("https://httpbin.org/get", headers = Seq("x-y" -> "a", "x-y" -> "b"))
310
+ assert(ujson.read(res)("headers")("X-Y") == Str("b")) // make sure it's not "a,b"
311
+ }
312
313
0 commit comments