-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use comma to divide headers (Fix #1765).
- Loading branch information
1 parent
3c54c68
commit a9c1c7b
Showing
6 changed files
with
92 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
ktor-client/ktor-client-tests/common/test/io/ktor/client/tests/engine/UtilsTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright 2014-2020 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package io.ktor.client.tests.engine | ||
|
||
import io.ktor.client.engine.* | ||
import io.ktor.client.utils.* | ||
import io.ktor.http.* | ||
import kotlin.test.* | ||
|
||
class UtilsTest { | ||
@Test | ||
fun testMergeHeaders() { | ||
val headers = HeadersBuilder().apply { | ||
append("Accept", "application/xml") | ||
append("Accept", "application/json") | ||
} | ||
|
||
val result = mutableMapOf<String, String>() | ||
mergeHeaders(headers.build(), EmptyContent) { | ||
key, value -> result[key] = value | ||
} | ||
|
||
assertEquals("application/xml,application/json", result["Accept"]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters