[MAGNOLIA-8821] VirtualURI mapping to URL with non ascii characters fails Created: 09/Mar/23 Updated: 07/Feb/24 Resolved: 01/Nov/23 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 6.2.29 |
| Fix Version/s: | 6.3.0, 6.2.41 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Jonathan Ayala | Assignee: | Rishab Dhar |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | Not Specified | Time Spent: | Not Specified |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Attachments: |
|
|||||||||||||||||||||||||
| Issue Links: |
|
|||||||||||||||||||||||||
| Sub-Tasks: |
|
|||||||||||||||||||||||||
| Template: | ||||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
|||||||||||||||||||||||||
| Task DoD: |
[X]*
Doc/release notes changes? Comment present?
[X]*
Downstream builds green?
[X]*
Solution information and context easily available?
[X]*
Tests
[X]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
|||||||||||||||||||||||||
| Bug DoR: |
[X]*
Steps to reproduce, expected, and actual results filled
[X]*
Affected version filled
|
|||||||||||||||||||||||||
| Release notes required: |
Yes
|
|||||||||||||||||||||||||
| Date of First Response: | ||||||||||||||||||||||||||
| Epic Link: | Support | |||||||||||||||||||||||||
| Sprint: | DevX 49 | |||||||||||||||||||||||||
| Story Points: | 3 | |||||||||||||||||||||||||
| Team: | ||||||||||||||||||||||||||
| Work Started: | ||||||||||||||||||||||||||
| Description |
Steps to reproduce
Expected resultsWe're redirected to http://localhost:8080/magnoliaAuthor/page-with-non-ascii-ä Actual resultsEncoding of non-ascii character fails and we are redirected to http://localhost:8080/magnoliaAuthor/page-with-non-ascii-%E4 instead, which returns a 404 WorkaroundDevelopment notesProperty magnolia_utf8_enabled is set to true |
| Comments |
| Comment by Samuli Saarinen [ 10/Mar/23 ] | |
|
When creating the fix it might be good to consider that the redirected url can have query parameters as well that can contain non-ascii values also | |
| Comment by David Martin [ 27/Jul/23 ] | |
|
Hi Magnolia Folks, Any news on when this issue will be fixed? We can workround it, but it's rather annoying to have to workround relatively fundamental issues like special characters in the URL that the Magnolia platform should handle out of the box. Cheers, Dave | |
| Comment by Rishab Dhar [ 18/Oct/23 ] | |
|
The issue was caused by MGNLCACHE-300 which used the below API to escape CRLF sequences in sanitization process from the redirect headers sent by the Magnolia.
This API caused the non-ASCII characters to also be escaped in the returned location header for the redirects. An alternate fix uses the RegexUtils API to explicitly escape only CRLF sequences from the returned header. The bug affects both 6.2 and 6.3 | |
| Comment by Rishab Dhar [ 20/Oct/23 ] | |
|
Created | |
| Comment by Christoph Meier [ 26/Oct/23 ] | |
|
It looks like the "fix" now also URL-encodes ;jsessionid=238029384 in some cases. I'm not sure whether that's fine. | |
| Comment by Rishab Dhar [ 30/Oct/23 ] | |
|
The original fix for VirtualURI mapping to URL UTF-8 encoded the entire URL of the format <scheme>://<username>:<password>@<host>:<port>/<path>;<parameters>?<query>#<fragment> which resulted in the ; and = in the parameters to be also be UTF-8 encoded, and the ? and = in query parameters to be also be encoded. However, this caused failed redirection in it.info.magnolia.eeintegrationtests.EEBasicTest#loginOnAuthorInstanceWithSuperuser where the ; and = in the jsessionid parameter. And in it.info.magnolia.eeintegrationtests.GdprTest#formConsent the ? and =. This and this PR escape all the separators for path and query params and the fragment in here. |