Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Acknowledge that HttpHeaders are case-insensitive #22723

Closed
cac03 opened this issue Apr 1, 2019 · 1 comment
Closed

Acknowledge that HttpHeaders are case-insensitive #22723

cac03 opened this issue Apr 1, 2019 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: documentation A documentation task
Milestone

Comments

@cac03
Copy link
Contributor

cac03 commented Apr 1, 2019

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


@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 1, 2019
@jhoeller jhoeller self-assigned this Apr 2, 2019
@jhoeller jhoeller added type: documentation A documentation task in: web Issues in web modules (web, webmvc, webflux, websocket) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Apr 2, 2019
@jhoeller jhoeller added this to the 5.1.7 milestone Apr 2, 2019
@jhoeller
Copy link
Contributor

jhoeller commented Apr 2, 2019

Thanks for raising this, we should indeed explicitly state the case-insensitive nature there. No need for a PR, I'll pick this up in my current round of 5.1 polishing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

3 participants