-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
Flashmap matching logic fails when target params are encoded. [SPR-9657] #14291
Comments
Rossen Stoyanchev commented The CharacterEncodingFilter sets the encoding of the request which is for the body and in this case the parameters are from the query string. Have you checked what encoding your servlet container uses for the URL and if there is a way to configure it? |
David Victor commented We are using Tomcat 6 - its setup as below.
Will keep looking. |
Rossen Stoyanchev commented It does look like an issue. I've added a project that demonstrates it and will try to address it soon. |
David Victor commented Thanks Rossen. Been looking more today. For now have added a workaround for our app - have extended i.e.
|
Rossen Stoyanchev commented This is now fixed in master and will also be backported to 3.1.3. |
Yannick Lazzari commented I know this is an old bug but I just stumbled onto the same problem. Before I reopen the issue I just wanted to double-check: is there a good reason we only decode the values of the request parameters and not their names as well? After all, they are part of the URL just as much as the values, no? I've tracked down the commit that fixes the issue (364bb69). I have this exact problem but my encoded characters are in the name of the parameters, not the values, which is not that uncommon considering the binding path naming convention for array/map parameters that use the square brackets, e.g. '/some/url?params[0]=value1¶ms[1]=value2' which gets encoded to '/some/url?params%5B0%5D=value1¶ms%5B1%5D=value2'. If you agree, I would re-open the issue. |
Rossen Stoyanchev commented Well you cannot re-open this issue as it is "closed" as it was already released and that will never change. You can open a new ticket with a new description. We'll link the two as related tickets. |
Yannick Lazzari commented |
David Victor opened SPR-9657 and commented
In our app we handle some request parameters which contain unicode characters.
Our web.xml has the familiar
org.springframework.web.filter.CharacterEncodingFilter
enabled to encode using UTF-8.One of our handler methods in a controller class redirects on success - and we add a success alert message to the flashmap in
RedirectAttributes
. We also add a couple of attributes to the "redirect model". This ends up with an encoded parameter in 'targetParams' - which fails to match to the relevant request via isFlashMapForRequest() inAbstractFlashMapManager
.Will try to add more useful detail - but am on limit of my knowledge here, and been banging head against this for a day now. The impact is that within our app the 'XXX successfully complete' flash message in the UI does not appear - due to not matching the flashmap - for encoded parameters. Fortunately these are in the minority - but its quite odd when the message mostly appears - and then sometimes doesn't. :-)
Affects: 3.1 GA
Sub-tasks:
Issue Links:
The text was updated successfully, but these errors were encountered: