[
https://issues.apache.org/jira/browse/WICKET-6878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17325742#comment-17325742
]
ASF subversion and git services commented on WICKET-6878:
---------------------------------------------------------
Commit d63af387f2750cb0e11ad58da870ca33ded85553 in wicket's branch
refs/heads/master from Martin Tzvetanov Grigorov
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=d63af38 ]
WICKET-6878 Rendering of relative Urls does not take into account filterpath
for absolute Urls
Urls created by Url#parse(fullUrlAsString) should be rendered as full url by
UrlRenderer#rendered(url), no matter whether it has the same scheme/host/port
as the base url.
Wicket usually works with relative urls, but if the user uses full url for some
reason then respect this and render it as full.
At the moment UrlRenderer#renderRelativeUrl(url) will render it as relative to
the current base url ignoring the scheme/host/port completely. This might be
correct or not but too at the moment there is no need to change this behavior.
(cherry picked from commit 50eb3c78cddd1918f4db2bd3bd7d2a67406c51ab)
> Rendering of relative Urls does not take into account filterpath for absolute
> Urls
> ----------------------------------------------------------------------------------
>
> Key: WICKET-6878
> URL: https://issues.apache.org/jira/browse/WICKET-6878
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 8.11.0
> Reporter: Hans Schäfer
> Assignee: Martin Tzvetanov Grigorov
> Priority: Major
> Attachments: wicket-6878.tgz
>
>
> Assume, there is an WicketApplication with mounted Page "error" running on
> [https://localhost:8443/ |https://localhost:8443/]
> The page "error" renders an reference for resource
> "https://localhost:8443/webjars/uilib/5.6.0/javascripts/bundle.all.js". The
> rendered Url is created by
> Url.parse("https://localhost:8443/webjars/uilib/5.6.0/javascripts/bundle.all.js").
> In this case everything is fine:
> [https://localhost:8443/error|https://localhost:8443/] renders tag <script
> type="text/javascript"
> src="[./webjars/uilib/5.6.0/javascripts/bundle.all.js|https://localhost:8443/webjars/uilib/5.6.0/javascripts/bundle.all.js]"></script>
> But if I change the filterpath of the application to "recovery", the
> following happens:
> [https://localhost:8443/recovery/error] renders tag <script
> type="text/javascript"
> src="[.//webjars/uilib/5.6.0/javascripts/bundle.all.js|https://localhost:8443/recovery//webjars/uilib/5.6.0/javascripts/bundle.all.js]"></script>
> This is not the expected value
> "../webjars/uilib/5.6.0/javascripts/bundle.all.js" of the src-Attribute.
> I tried to break it down: The rendered Url in the script tag is created by
> the UrlRenderer. The UrlRenderer decides to render a relative url as scheme,
> host and port match the corresponding properties of the clientUrl and the Url
> is not "contextabsolute" (as it contains an hostname). I think, this is
> absolutly fine. But during rendering the relative url the UrlRenderer does
> not detect, that it has to handle this url separatly. The segments of the Url
> contain a leading "" (for /) which is not followed by the filterpath. I
> assume, this should be resolved to ".." for every part of the filterpath.
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)