-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed as not planned
Closed as not planned
Copy link
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply
Description
Affects: 6.1.12
the content of a parameter annotated with @RequestBody should contain the body of the request as sent to the server but it is encoded wrong
The following example controller:
@RestController
public class AsteriskController {
private static final Logger log = LoggerFactory.getLogger(AsteriskController.class);
@PostMapping(value = "/message", consumes = "application/x-www-form-urlencoded")
public void message(@RequestBody String body) {
log.info("Received body: {}", body);
}
}when sent the following request
curl -L 'localhost:8080/message' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'payload=%7B%22text%22%3A%22%2ABe%2Bnotified%2A%22%7D'prints out
Received body: payload=%7B%22text%22%3A%22*Be%2Bnotified*%22%7D
whereas it should print
Received body: payload=%7B%22text%22%3A%22%2ABe%2Bnotified%2A%22%7D
The * encoded as %2A is decoded and encoded wrong somehow in the filter chain when parsing the request
daberni
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply