jdaugherty commented on code in PR #16760: URL: https://github.com/apache/grails-core/pull/16760#discussion_r4379591843
########## grails-doc/src/en/guide/upgrading/upgrading90x.adoc: ########## @@ -1229,3 +1229,14 @@ See <<asyncPromises,Promises>> and <<events,Events>>. `grails-async-rxjava3` carries a `null` value as the RxJava 1 factory and every other promise factory do: `createPromise()` and `createPromise(Class)` give a promise whose `get()` returns `null`, a task that returns `null` resolves to `null`, and a `null` value keeps its place in the list that `onComplete`, `onError` and `waitAll` deliver. `grails-async-rxjava2` does not: there `createPromise()` and `onComplete` over a list holding a bound promise of `null` fail with a `NullPointerException`, and a task that returns `null` resolves to the `java.lang.Void` class. + +==== 20. Spring Boot Registers the Character Encoding Filter + +Grails no longer registers a character encoding filter of its own. It used to, and Spring Boot's backed off, so `spring.servlet.encoding` had no effect in a Grails application. Spring Boot's filter now decodes requests: it runs at `Ordered.HIGHEST_PRECEDENCE`, ahead of every other filter, and `spring.servlet.encoding` configures it. + +* The request encoding is now overridden by default, as in any Spring Boot application, so a request that declares a charset of its own is still decoded as UTF-8: its parameters, a body read through `getReader()`, `request.JSON` and `request.XML`, and a JSON or XML body bound to a command object or domain class. To keep the charset a request declares, as Grails 8 did, set `spring.servlet.encoding.force-request: false`. Review Comment: "a request that declares a charset of its own is still decoded as UTF-8: its parameters" doesn't hold for PUT, PATCH and DELETE forms. Grails gets their parameters from `FormContentFilter`, which takes the charset from the `Content-Type` header before it falls back to `request.getCharacterEncoding()` (`ServletServerHttpRequest.getHeaders()`), so a declared charset still wins there, forced or not. Grails 8 behaves the same way, so this is an exception to name rather than a change, for example "its parameters, except those of a PUT, PATCH or DELETE form, which keep the declared charset". I traced this through the Spring code and didn't run it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
