Skip to content

Commit 927132b

Browse files
authored
Add test for #163 (#164)
1 parent fa71753 commit 927132b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

requests/test/src/requests/RequestTests.scala

+8
Original file line numberDiff line numberDiff line change
@@ -301,5 +301,13 @@ object RequestTests extends TestSuite{
301301
}
302302
}
303303
}
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+
}
304312
}
305313
}

0 commit comments

Comments
 (0)