Skip to content

@PathVariables not URL encoded  #53

Closed
@eranation

Description

@eranation

In a classic Spring deployment (e.g. on a standalone / built in Spring Boot embedded Tomcat), when you get a @PathVariable, usually it's already URL decoded, e.g. if I send a request to

/foo/bar/Some%20Thing

to a

@GetMapping("/foo/bar/{baz}")
public void handle(@PathVariable("baz") String baz) …

then baz should be "Some Thing"

This can be fixed in the Lambda handler easily, but I think it will be nice the container will take care of it (can be a configuration param as it's a breaking change)

Right now the workaround I used is simply:

request.setPath(java.net.URLDecoder.decode(request.getPath(), "UTF-8"));

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions