[MAGNOLIA-6859] Use of RequestParametersVoter gives ClassCastException Created: 02/Sep/16 Updated: 28/Feb/17 Resolved: 23/Feb/17 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | cache |
| Affects Version/s: | 5.4.9 |
| Fix Version/s: | 5.4.12, 5.5.3 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Marcus Käppi | Assignee: | Jaroslav Simak |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Patch included: |
Yes
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Date of First Response: | |||||||||
| Sprint: | Kromeriz 84 | ||||||||
| Story Points: | 2 | ||||||||
| Description |
|
Can be reproduced by: /modules/cache/config/contentCaching/defaultPageCache/cachePolicy/shouldBypassVoters/deny/parameters to the configuration in the attachment will cause a ClassCastException when visiting any page on public instance. (see attachment) |
| Comments |
| Comment by Marcus Käppi [ 06/Sep/16 ] |
|
Attached suggested solution. |
| Comment by Jan Haderka [ 04/Nov/16 ] |
|
While what you propose here will seemingly fix the voter by making it able to accept any parameter not just request, it is likely not correct solution in case of caching & voting. The bypass voters (where you configure RPV according to screenshot) operates on CacheKey and passed down to valuation the request URI. The parameters recorded in the key might be different to those in current request, depending on the implementation of the key, so result from validation performed with modified voter will not be correct in all cases where it will be used. |
| Comment by Roman Kovařík [ 02/Dec/16 ] |
|
Hello buf481, as you can see in the javadoc of RequestParametersVoter, this voter takes javax.servlet.http.HttpServletRequest as an argument and was never meant to be used with other types. Best regards |