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...
Comment From: simonbasle
Keeping track of notable areas where we check for generic Map
for headers (and now should check for both Map
and HttpHeaders
):
- RequestHeaderMapMethodArgumentResolver
- RequestHeaderMethodArgumentResolver
Comment From: simonbasle
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)
- ...