Stephan Schröder
11/22/2024, 11:25 AMval req = call.request
...
val headers = req.headers.entries().sortedBy {
entry -> entry.key
}.map { it.key to it.value }
appendLine("request headers: (nr of headers=${headers.size})")
headers.forEach { (name: String, values: List<String>) ->
appendLine("$name: ${values.joinToString{"[$it]"}}")
}
but wenn I send the following IntelliJ Http Request
### GET request with double Accept header
GET <http://localhost:8080/test>
Accept: text/html; q=0.5
Accept: text/plain; q=0.2
###
I only log:
request headers: (nr of headers=4)
Accept: [text/plain; q=0.2]
Accept-Encoding: [br, deflate, gzip, x-gzip]
User-Agent: [IntelliJ HTTP Client/IntelliJ IDEA 2024.3]
host: [localhost:8080]
so the text/html; q=0.5-part is missing. This isn't the indended behaviour, is it? 🤔Thomas Urbanitsch
11/22/2024, 11:54 AMAccept: text/html;q=0.5, text/plain;q=0.2
in your case 🤔Stephan Schröder
11/22/2024, 12:01 PMAccept: text/html;q=0.5, text/plain;q=0.2
it's just a single element containing the whole String "Accept: text/html;q=0.5, text/plain;q=0.2" (which surprised me, I thought ktor would split it up automatically)Aleksei Tirman [JB]
11/22/2024, 12:04 PMGET / HTTP/1.1
Accept: text/plain; q=0.2
User-Agent: IntelliJ HTTP Client/IntelliJ IDEA 2024.3
Accept-Encoding: br, deflate, gzip, x-gzip
host: localhost:8092
As you can see, it doesn't contain the first Accept header.Stephan Schröder
11/22/2024, 12:46 PMStephan Schröder
11/22/2024, 12:48 PMAccept: [text/html; q=0.5], [text/plain; q=0.2]