-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Using RouterFunctions.route() results in exception #3265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@bsgrd try pass requestBody. |
I'm unable to reproduce this using this initializr setup If you'd like us to spend some time investigating, please take the time to provide a complete, minimal, verifiable sample (something that we can unzip attached to this issue or git clone, build, and deploy) that reproduces the problem. |
Hi @spencergibb |
I still can't reproduce with your repository. How are you making the http request? |
@spencergibb weird. I'm doing a simple POST request with postman and a random json body. |
BTW. I should mention that I'm using Java 21. Don't know if that makes a difference. Though i get the same error with java 17. |
@spencergibb I'm still getting the same error with your fix. |
Using |
Describe the bug
When I try to read or modify the request body in spring-cloud-gateway-mvc, the body is removed from the request and this exception is thrown:
I'm using Spring Boot 3.2.2 and cloud 2023.0.0
Sample
I have tried using the BeforeFilterFunctions.modifyRequestBody:
.before(modifyRequestBody(String.class, String.class, MediaType.APPLICATION_JSON_VALUE, (serverRequest, s) -> s))
.. and also a regular filter like this:
I have used the example from the documentation: ModifyRequestBody Filter
The text was updated successfully, but these errors were encountered: