Skip to content

Acknowledge that HttpHeaders are case-insensitive #22723

@cac03

Description

@cac03

Affects: 5.1

Hello,

currently HttpHeaders' documentation does not acknowledge that HttpHeaders behave in case-insensitive manner.

Per RFC 7230:

Each header field consists of a case-insensitive field name followed by a colon (":"), optional leading whitespace, the field value, and optional trailing whitespace.

It may be confusing in the presence of publicly exposed HttpHeaders(MultiValueMap<String, String>) constructor by this commit.

Do I understand right that the constructor is intended to be used by the framework itself only? @bclozel


Here is a question on StackOverflow asking whether the HttpHeaders are case-insensitive.

I had answered the question relying on the fact that there had been only one publicly available constructor utilized LinkedCaseInsenitiveMap underneath.

But now I'm a little bit doubtful because of the HttpHeaders(MultiValueMap<String, String>) constructor.

I've edited the answer accordingly


May I submit a pull request clarifying the documentation that:

  • HttpHeaders are case-insensitive
  • HttpHeaders(MultiValueMap<String, String>) is only for internal use (if the fact is acknowledged)
    ?

Thank you for your time


Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions