Affects: Spring Boot 2.6.1 and 2.6.14
I'm facing a bug that I'm able to reproduce in different projects with Java 11 and Spring Boot 2.6.1 and 2.6.14.
This error happens only when the request contains some diacritic text. Example: firstname: Ève
When the request does not contain a payload, the application receives Ève
.
When the request contains a payload, the application receives à ve
.
According to my tests the payload content doesn't matter.
This curl
command triggers the bug:
curl --location --request POST 'http://localhost:8080/hello' \
--header 'Content-Type: application/json' \
--header 'firstname: Ève' \
--data-raw '{ }'
This curl
command does not trigger the bug:
curl --location --request POST 'http://localhost:8080/hello' \
--header 'Content-Type: application/json' \
--header 'firstname: Ève'`
Is it a known issue?
Is it already fixed for last versions?
I've found nothing related to that.
Regards
Comment From: sbrannen
Hi @Guidebom,
Congratulations on submitting your first issue for the Spring Framework! 👍
If you would like for us to assist you, please provide a minimal sample application (or integration test) that demonstrates the issue -- preferably as a public Git repository or ZIP file that we can download and run.
Thanks
Comment From: Guidebom
Hi @sbrannen thanks for the quick answer.
You can find the project here: https://github.com/Guidebom/diacritic-bug/tree/main
Please let me know if you need anything else.
Comment From: rstoyanchev
I'm not able to reproduce the issue. Note that I needed to modify the sample to change the "/hello" method to a POST mapping, and also pass the HttpServletRequest
into the controller method. That aside I get the same result with both sample curl requests when I call request.getHeader("firstname")
.
Moreover, the description is for values that come from the HttpServletRequest
and thus not related to anything that Spring MVC does. If you want to confirm that, I suggest using a Filter (i.e. before it gets to Spring MVC) or a plain Servlet.
I'm closing the issue as it is most likely not anything related to Spring MVC but feel free to comment further.