-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issueA duplicate of another issue
Description
Mats Svensson opened SPR-11474 and commented
Code below
// this works, tagId is properly decoded
@RequestMapping(value = "/tag/{tagId}", method = RequestMethod.PUT)
public @ResponseBody SourceTag updateTag(@RequestBody SourceTag newTag, @PathVariable("tagId") String tagId) {
return sourceService.updateTag(new SourceTag(tagId), newTag);
}
// but here it fails!
@RequestMapping(value = "/tag/{tagId}", method = RequestMethod.DELETE)
public @ResponseBody SourceTag updateTag(@PathVariable("tagId") String tagId) {
// something
}
When trying to access
/tag/mmm%C3%A6%C3%A6%C3%B8%C3%A5 as PUT with an object, the
pathvariable tagId contains the value "mmmææøå"
But when accessing
/tag/mmm%C3%A6%C3%A6%C3%B8%C3%A5 as DELETE
the pathvariable tagId contains the value "mmmææøå"
After testing, the problem seems not to be using DELETE instead of PUT, but having a @RequestBody
and not having one.
Affects: 3.2.8, 4.0.2
Issue Links:
- Better handling of URI encoding configuration [SPR-11925] #16543 Better handling of URI encoding configuration
- Form parameters should be in UTF-8 encoding [SPR-11779] #16401 Form parameters should be in UTF-8 encoding
Referenced from: commits spring-attic/spring-framework-issues@d2cb761, spring-attic/spring-framework-issues@1e4ef2b
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issueA duplicate of another issue