-
Notifications
You must be signed in to change notification settings - Fork 30
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
Special character encoding issues with SingleSignOutFilter #16
Comments
I have the same problem, please fix this problem asap. |
@dpcasady could you submit a sample app so that I can fix it, create a test for it and release a new version? |
Here's a sample app: Run the app and send some post data to it with special characters:
The
If you disable spring security cas, you'll see |
This issue breaks UTF-8 completely in Grails 3.3.x. Workaround:
Ordered.HIGHEST_PRECEDENCE + 1 does not work, since CharacterEncodingFilter has order FilterRegistrationBean.REQUEST_WRAPPER_FILTER_MAX_ORDER + 10 in Grails 3.3.x I really hope this will be fixed soon. This issue is open since 2017 and nobody took care so far. |
Workaround update for grails 5.1.7. This work form me
|
A dia de hoy sigue sin arreglarse, la ñ pasa a ser à e igual que las letras acentuadas.. |
I've checked out the provided sample app grails-cas-encoding and ran it locally. It seems to work totally fine as it is (no need to disable spring security cas): $ curl -si -dstring=® http://localhost:8080/application
HTTP/1.1 200
X-Application-Context: application:development
Content-Type: text/html;charset=utf-8
Transfer-Encoding: chunked
Date: Mon, 15 Jan 2024 09:56:47 GMT
string: ® The controller returns a valid UTF-8 response, echoing the Maybe your CLI application was not handling the response properly? 🤔 |
with sample app grails-cas-encoding curl -si -dstring=® http://localhost:8080/application string: ® It's the same problem.. |
@funcoleto I believe the app is returning the correct response, but your command line application is not interpreting UTF-8 correctly. Could you please run this test locally and tell us the response you get? curl -s -dstring=`echo 'wq4=' | base64 -d` http://localhost:8080/application | base64 |
curl -s -dstring= |
@funcoleto Thanks for your help! That's not the same response I get when I run it locally 🤔 Could you tell me which OS / JDK version are you using to run the app? |
% grails --version % sw_vers with java 17 is the some problem.. |
The Grails default UTF-8
characterEncodingFilter
no longer encodes special characters correctly in an app with the Spring Security CAS plugin.I believe this is due to the
SingleSignOutFilter
's registration order being set toOrdered.HIGHEST_PRECEDENCE
and thus being first in the filter chain instead of the encoding filter. Not that this is the solution, but by setting the SingleSignOutFilter's order toOrdered.HIGHEST_PRECEDENCE + 1
, and customizing characterEncodingFilter with orderOrdered.HIGHEST_PRECEDENCE
seems to fix the problem.This is most easily demonstrated by submitting a post request to a controller with special characters, e.g. ™, ®, etc. in it.
The text was updated successfully, but these errors were encountered: