codeconsole commented on code in PR #16760: URL: https://github.com/apache/grails-core/pull/16760#discussion_r4381325779
########## 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: You're right, and it holds when run. In app1, with the encoding forced, a PUT, PATCH or DELETE form encoded as ISO-8859-1 and sent with `charset=ISO-8859-1` reaches the controller as `Café`, so the declared charset wins. A POST form encoded as UTF-8 that declares ISO-8859-1 is decoded as UTF-8. With `spring.servlet.encoding.force-request: false`, the POST case gets `Café` and the PUT, PATCH and DELETE cases are unchanged. 127907da50 names the exception in §20 and in the skill, in the wording you suggested, and adds these cases to `CharacterEncodingSpec`. -- 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]
