You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Justin Edelson (JIRA)" <ji...@apache.org> on 2014/04/01 19:25:28 UTC
[jira] [Updated] (SLING-3338)
SlingHttpServletResponseImpl.encodeURL(String) and
encodeRedirectURL(String) return wrong Url in multiple domain setups
[ https://issues.apache.org/jira/browse/SLING-3338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Justin Edelson updated SLING-3338:
----------------------------------
Assignee: Justin Edelson
> SlingHttpServletResponseImpl.encodeURL(String) and encodeRedirectURL(String) return wrong Url in multiple domain setups
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: SLING-3338
> URL: https://issues.apache.org/jira/browse/SLING-3338
> Project: Sling
> Issue Type: Bug
> Components: Engine
> Affects Versions: Engine 2.2.8
> Reporter: Markus Haack
> Assignee: Justin Edelson
> Labels: jstl, mapping, taglib
> Fix For: Engine 2.3.0
>
>
> The <c:url> JSTL tag (org.apache.taglibs.standard.tag.rt.core.UrlTag) does not work with multi domain mappings configured to the same path.
> org.apache.taglibs.standard.tag.rt.core.UrlTag uses
> org.apache.taglibs.standard.tag.common.core.UrlSupport which calls
> response.encodeURL(result); in the doEndTag method. That goes down to
> org.apache.sling.engine.impl.SlingHttpServletResponseImpl.encodeUrl(String).
> SlingHttpServletResponseImpl.encodeUrl calls SlingHttpServletResponseImpl.map(String) without the request. This can result in wrong mapping if more than one mapping matches always the frist one is picked.
> Can be reproduces by using the following mapping config:(http://localhost:4503/etc/map/http.tidy.-1.json):
> {
> "jcr:primaryType": "sling:Folder",
> "host-a1.com": {
> "jcr:createdBy": "admin",
> "sling:internalRedirect": [
> "/content/a",
> "/"
> ],
> "jcr:primaryType": "sling:Mapping"
> },
> "host-a2.com": {
> "sling:internalRedirect": [
> "/content/a",
> "/"
> ],
> "jcr:primaryType": "sling:Mapping"
> }
> }
> When using <c:url> to encode a link a request on host-a1.com works fine. The return value of the tag is a relative link. Access via host-a2.com is broken and <c:url> return a full link pointing to domain hoas-a1.com.
--
This message was sent by Atlassian JIRA
(v6.2#6252)