You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then on the scala side this is represented as Some(NonEmptyList(X-Foo: 123, X-Foo: 456))
but according to the RFC passing them as a comma separated list should be equivalent:
$ curl localhost:8080 -H "X-Foo:123, 456"
However above is represented as Some(NonEmptyList(X-Foo: 123, 456))
Since http4s does already a great job when it comes to parsing low-level http data in every other area we wonder whether it would make sense also to support this case. What do you think?
tested on: 0.23.25
The text was updated successfully, but these errors were encountered:
but according to the RFC passing them as a comma separated list should be equivalent
Actually, I'm not sure that the server MUST interpret these values as having two values, "123" and "456", not as a single value "123, 456".
https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.2
A sender MUST NOT generate multiple header fields with the same field
name in a message unless either the entire field value for that
header field is defined as a comma-separated list [i.e., #(values)]
or the header field is a well-known exception (as noted below).
A recipient MAY combine multiple header fields with the same field
name into one "field-name: field-value" pair, without changing the
semantics of the message, by appending each subsequent field value to
the combined field value in order, separated by a comma. The order
in which header fields with the same field name are received is
therefore significant to the interpretation of the combined field
value; a proxy MUST NOT change the order of these field values when
forwarding a message.
Also, in the latest spec
https://www.rfc-editor.org/rfc/rfc9110.html
A recipient MAY combine multiple field lines within a field section that have the same field name into one field line, without changing the semantics of the message, by appending each subsequent field line value to the initial field line value in order, separated by a comma (",") and optional whitespace (OWS, defined in Section 5.6.3). For consistency, use comma SP.
Hi,
We noticed that there is a difference in how headers are parsed depending on how multiple headers are passed.
It is ok if they are passed separately:
then on the scala side this is represented as
Some(NonEmptyList(X-Foo: 123, X-Foo: 456))
but according to the RFC passing them as a comma separated list should be equivalent:
$ curl localhost:8080 -H "X-Foo:123, 456"
However above is represented as
Some(NonEmptyList(X-Foo: 123, 456))
Since http4s does already a great job when it comes to parsing low-level http data in every other area we wonder whether it would make sense also to support this case. What do you think?
tested on: 0.23.25
The text was updated successfully, but these errors were encountered: