https://kotlinlang.org logo
#http4k
Title
# http4k
d

dave

08/13/2019, 7:49 AM
@Dmitry Kandalov it's been a while now, but I seem to recall that it was added purely as an aid to testing, so the order of added headers was disregarded when performing a comparison. I for one have never actually ever used it in prod code.
u

Uberto Barbini

08/16/2019, 8:30 AM
is the order of the headers relevant in HTTP protocol? if now why not using a Set?
d

dave

08/16/2019, 8:56 AM
The internet says kind of from a 5 second search. RFC says:
Copy code
The order in which header fields with differing field names are received is not significant.
and we have a test to cover that:
Copy code
@Test
    fun `if multiple headers with the same key exist in two headers, they must be in the same order for the headers to be equal`()
u

Uberto Barbini

08/16/2019, 10:43 AM
So... wouldn't be better a map HeaderName -> List<String> ? 🙂