Support headers with multiple values in ResponseStatusException #24261
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: enhancement
A general enhancement
Milestone
Affects: Spring-web 5.1.11 & 5.2.1
Spring-web got in version 5.1.11 very useful feature to transfer headers from
ResponseExceptions
toResponseStatusExceptionHandler
(first mentioned in #23741 and implements in 614c7b0).Faced with problem: new mechanism can't transfer multivalues headers like
in raw-style (in a
Map<String, List<String>>
in this case).ResponseStatusException.getHeaders returns simple
java.util.Map
.Nowadays I can transfer multivalues only by converting to delimeted string (for example) and from it in exception handler. Looks lile a bycicle :(
Listing in
org.springframework.web.server.ResponseStatusException
Listing in org.springframework.web.server.handler.ResponseStatusExceptionHandler
Note, that
ServerHttpResponse.getHeaders()
returnsHttpHeaders
that implementsMultiValueMap<String, String>
Are any restrictions here for using
MultiValueMap
inResponseStatusException.getHeaders()
instead ofMap
?Seems better to have more flexible mech
The text was updated successfully, but these errors were encountered: