Skip to content

Add option to encode MultiValueMap of query params  #24043

@OrangeDog

Description

@OrangeDog

Parameters passed using %-encoding will be double escaped by fromCurrentRequest():

@GetMapping
@ResponseBody
public Map<String, Object> test(@RequestParam MultiValueMap<String, String> params) {
    return Map.of(
            "params", params,
            "uri", ServletUriComponentsBuilder.fromCurrentRequest().toUriString()
    );
}
$ curl http://localhost:8080/?p=*
{"uri":"http://localhost:8080/?p=*","params":{"p":["*"]}}

$ curl http://localhost:8080/?p=%2a
{"uri":"http://localhost:8080/?p=%252a","params":{"p":["*"]}}

Spring Web 5.2.1.RELEASE

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions