File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
ktor-client-core/common/src/io/ktor/client/engine
ktor-client-tests/common/test/io/ktor/client/tests/plugins Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ public fun mergeHeaders(
47
47
block(key, value)
48
48
}
49
49
} else {
50
- block(key, values.joinToString(" ," ))
50
+ val separator = if (HttpHeaders .Cookie == key) " ; " else " ,"
51
+ block(key, values.joinToString(separator))
51
52
}
52
53
}
53
54
Original file line number Diff line number Diff line change @@ -246,5 +246,17 @@ class CookiesTest : ClientLoader() {
246
246
}
247
247
}
248
248
249
+ @Test
250
+ fun testSeparatedBySemicolon () = clientTests(listOf (" Js" )) {
251
+ test { client ->
252
+ client.get(" $TEST_HOST /encoded" ) {
253
+ cookie(" firstCookie" , " first" )
254
+ header(" Cookie" , " secondCookie=second" )
255
+ }.bodyAsText().also {
256
+ assertEquals(" firstCookie=first; secondCookie=second" , it)
257
+ }
258
+ }
259
+ }
260
+
249
261
private suspend fun HttpClient.getId () = cookies(hostname)[" id" ]!! .value.toInt()
250
262
}
You can’t perform that action at this time.
0 commit comments