[ https://issues.apache.org/jira/browse/WICKET-5843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14384687#comment-14384687 ]
ASF subversion and git services commented on WICKET-5843: --------------------------------------------------------- Commit 03d94aae2d56d6d15787e470f39372256b122e56 in wicket's branch refs/heads/wicket-6.x from [~mgrigorov] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=03d94aa ] WICKET-5843 CryptoMapper doesn't work with context relative UrlResourceReferences Return the original Url if there was no encryption. (cherry picked from commit 55f164e4bc20ef4d54aaafbfbc79ffeb58f37caa) > CryptoMapper doesn't work with context relative UrlResourceReferences > --------------------------------------------------------------------- > > Key: WICKET-5843 > URL: https://issues.apache.org/jira/browse/WICKET-5843 > Project: Wicket > Issue Type: Bug > Components: wicket > Affects Versions: 6.19.0 > Reporter: Tim Koopman > > Adding a CryptoMapper to the application causes context relative URL's to be > rendered twice, causing them to stop working. > For example a webjar resource is rendered as: > ||page||rendered url|| > |/|./webjars/jquery/1.11.2/jquery.js| > |/admin|./webjars/jquery/1.11.2/jquery.js| > |/admin/configuration|../../webjars/jquery/1.11.2/jquery.js| > |/admin/configuration/|../../../../webjars/jquery/1.11.2/jquery.js| > The last two urls won't work as they point to urls outside the context root. > The reason this happens is because UrlResourceReference#getUrl returns a > UrlResourceReference$CalculatedUrl, which is normally skipped by > UrlRenderer#renderRelativeUrl. > But in the case of CryptoMapper, this CalculatedUrl is converted to a normal > Url (in CryptoMapper#encryptRequestListenerParameter) which isn't skipped. > So, when you have a CryptoMapper all context relative urls are converted > twice: once by UrlRenderer#renderContextRelativeUrl and again by > UrlRenderer#renderRelativeUrl. > A quick fix would be to ignore all url's of type IUrlRenderer in > CrytoMapper's mapHandler, but I don't know it this the wanted solution. It > seems pretty weird to me that conversion is done twice at all. -- This message was sent by Atlassian JIRA (v6.3.4#6332)