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

Revisit HttpHeaders implementing the MultiValueMap API #33913

Closed
simonbasle opened this issue Nov 19, 2024 · 2 comments
Closed

Revisit HttpHeaders implementing the MultiValueMap API #33913

simonbasle opened this issue Nov 19, 2024 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@simonbasle
Copy link
Contributor

simonbasle commented Nov 19, 2024

See #33823 : the MultiValueMap methods that iterate over the whole header collection misalign with some underlying server implementations.

On the other hand having HttpHeaders implement MultiValueMap brings in some (marginal?) benefits: using CollectionUtils, asserting headers with map-specific assertions, putting all the headers into a plain Map (map.putAll(headers)), etc...

@simonbasle simonbasle added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels Nov 19, 2024
@simonbasle simonbasle added this to the 7.0.x milestone Nov 19, 2024
@simonbasle simonbasle self-assigned this Nov 19, 2024
@simonbasle simonbasle changed the title Revisit HttpHeaders implementing the MultiValueMap API Revisit HttpHeaders implementing the MultiValueMap API Nov 19, 2024
@simonbasle simonbasle added the status: pending-design-work Needs design work before any code can be developed label Nov 20, 2024
@simonbasle
Copy link
Contributor Author

Keeping track of notable areas where we check for generic Map for headers (and now should check for both Map and HttpHeaders):

  • RequestHeaderMapMethodArgumentResolver
  • RequestHeaderMethodArgumentResolver

@simonbasle
Copy link
Contributor Author

simonbasle commented Dec 24, 2024

Notable possible additions to HttpHeaders API that could be backported to 6.2.x:

  • getOrEmpty using a String key
  • getOrDefault (similarly using a String key)
  • addAll(HttpHeaders)
  • containsHeader(String headerName)
  • hasHeaderValues(String, List<String>)
  • containsHeaderValue(String, String)
  • putAll(HttpHeaders)
  • remove(String)
  • ...

@simonbasle simonbasle modified the milestones: 7.0.x, 7.0.0-M1 Dec 24, 2024
@simonbasle simonbasle removed the status: pending-design-work Needs design work before any code can be developed label Dec 24, 2024
simonbasle added a commit that referenced this issue Dec 26, 2024
Javadoc links to `HttpHeaders#remove` now use the new String-based
signature.

See gh-33913
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: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant