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
It may confuse the client and lead to failures. I wonder if it is worth changing the semantics of HttpResponseBuilder API to reduce the risk of having duplicated content-type entries. For example, we can make the last specified content-type win. I hope to learn what you think, thanks :)
The text was updated successfully, but these errors were encountered:
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).
I wasn't able to find any practical use-cases not defined by the rfc from a simple google search either.
Having said this, let me wait ask the other maintainers as well since I may be missing something.
responseBuilder.content(responseMsg) // This adds a response header content-type: text/plain; charset=utf-8
#5020
I think other maintainers have the same opinion that we need to fix not to set the default content-type or lazily set on build() method if missing.
Talked with the others, instead of enforcing the validation of a single content-type in ResponseHeaders, it's probably enough to not set a content-type when calling content.
How we can do this without introducing breaking changes may need further discussion though.
We are on Armeria 1.16.3 and we noticed that the below code pattern can yield a HTTP response with 2 entries keyed by
content-type
:One the client side, the received HTTP response headers contain:
It may confuse the client and lead to failures. I wonder if it is worth changing the semantics of
HttpResponseBuilder
API to reduce the risk of having duplicatedcontent-type
entries. For example, we can make the last specifiedcontent-type
win. I hope to learn what you think, thanks :)The text was updated successfully, but these errors were encountered: