You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2009/06/03 08:52:07 UTC

[jira] Created: (SLING-991) JcrResourceResolver2.map does not handle resource paths with fragments and queries correctly

JcrResourceResolver2.map does not handle resource paths with fragments and queries correctly
--------------------------------------------------------------------------------------------

                 Key: SLING-991
                 URL: https://issues.apache.org/jira/browse/SLING-991
             Project: Sling
          Issue Type: Bug
          Components: JCR Resource
    Affects Versions: JCR Resource 2.0.4
            Reporter: Felix Meschberger
            Assignee: Felix Meschberger
             Fix For: JCR Resource 2.0.6


The JcrResourceResolver2.map(HttpServletRequest, String) method does not handle any fragements and queries in the resource path correctly, when mapping from the internal path to the external URL.

The intent of the map method is to take any string, which is prepared to act as a link URL and to map the resource path to a valid URL, which may be resovled by the resolve method. Any selectors, extension and suffix are correctly cut of the path to get the raw resource path to map. But fragments and queries are not handled correclty.

Consider the following examples based on an existing resource /content/home:

  /content/home --> use as is, nothing to cut off
  /content/home.html --> cut off extension before mapping
  /content/home.sel.html --> cut off selector and extension before mapping
  /content/home.html/some/suffix --> cut off extension and suffix before mapping
  /content/home.html#sec1?a:b=1 --> cut off extension, fragment and query before mapping

The last part is not being done currently, which is a problem and might leed to wrong mapping results, particularly if the query contains colons, which would result in wrong namespace mangling.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (SLING-991) JcrResourceResolver2.map does not handle resource paths with fragments and queries correctly

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger closed SLING-991.
-----------------------------------


This can be closed

> JcrResourceResolver2.map does not handle resource paths with fragments and queries correctly
> --------------------------------------------------------------------------------------------
>
>                 Key: SLING-991
>                 URL: https://issues.apache.org/jira/browse/SLING-991
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR Resource
>    Affects Versions: JCR Resource 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.6
>
>
> The JcrResourceResolver2.map(HttpServletRequest, String) method does not handle any fragements and queries in the resource path correctly, when mapping from the internal path to the external URL.
> The intent of the map method is to take any string, which is prepared to act as a link URL and to map the resource path to a valid URL, which may be resovled by the resolve method. Any selectors, extension and suffix are correctly cut of the path to get the raw resource path to map. But fragments and queries are not handled correclty.
> Consider the following examples based on an existing resource /content/home:
>   /content/home --> use as is, nothing to cut off
>   /content/home.html --> cut off extension before mapping
>   /content/home.sel.html --> cut off selector and extension before mapping
>   /content/home.html/some/suffix --> cut off extension and suffix before mapping
>   /content/home.html#sec1?a:b=1 --> cut off extension, fragment and query before mapping
> The last part is not being done currently, which is a problem and might leed to wrong mapping results, particularly if the query contains colons, which would result in wrong namespace mangling.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SLING-991) JcrResourceResolver2.map does not handle resource paths with fragments and queries correctly

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved SLING-991.
-------------------------------------

    Resolution: Fixed

Applied fix to this problem in Rev. 781285:

  * Cut off fragment and/or query before applying mapping algorithm
  * Append fragment and/or query after the mapping
  * Remove special query handling from the mangleNameSpaces method introduced with SLING-906
  * Add test cases

> JcrResourceResolver2.map does not handle resource paths with fragments and queries correctly
> --------------------------------------------------------------------------------------------
>
>                 Key: SLING-991
>                 URL: https://issues.apache.org/jira/browse/SLING-991
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR Resource
>    Affects Versions: JCR Resource 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.6
>
>
> The JcrResourceResolver2.map(HttpServletRequest, String) method does not handle any fragements and queries in the resource path correctly, when mapping from the internal path to the external URL.
> The intent of the map method is to take any string, which is prepared to act as a link URL and to map the resource path to a valid URL, which may be resovled by the resolve method. Any selectors, extension and suffix are correctly cut of the path to get the raw resource path to map. But fragments and queries are not handled correclty.
> Consider the following examples based on an existing resource /content/home:
>   /content/home --> use as is, nothing to cut off
>   /content/home.html --> cut off extension before mapping
>   /content/home.sel.html --> cut off selector and extension before mapping
>   /content/home.html/some/suffix --> cut off extension and suffix before mapping
>   /content/home.html#sec1?a:b=1 --> cut off extension, fragment and query before mapping
> The last part is not being done currently, which is a problem and might leed to wrong mapping results, particularly if the query contains colons, which would result in wrong namespace mangling.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.