[
https://issues.apache.org/jira/browse/SLING-1218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Felix Meschberger reassigned SLING-1218:
----------------------------------------
Assignee: Felix Meschberger
> JcrResourceResolver.map() does not return proper escaped URIs
> -------------------------------------------------------------
>
> Key: SLING-1218
> URL: https://issues.apache.org/jira/browse/SLING-1218
> Project: Sling
> Issue Type: Bug
> Components: JCR
> Affects Versions: JCR Resource 2.0.6
> Reporter: Alexander Klimetschek
> Assignee: Felix Meschberger
> Attachments: SLING-1218.patch
>
>
> The JcrResourceResolver's map() methods do not escape the URIs that are
> returned (as string). For example, a path with spaces (which is valid in JCR)
> such as
> /content/path/with spaces.jpg
> will be returned as-is (or like "http://my.domain.com/content/path/with
> spaces.jpg" if a mapping config is present for that). However, it should be
> returned as
> /content/path/with%20spaces.jpg
> (Or in case of a mapping config, like
> "http://my.domain.com/content/path/with%20spaces.jpg").
> Furthermore, in case of a mapping config present, an URISyntaxException
> exception will be thrown in line 384 of JcrResourceResolver as the uri string
> "mappedPath" contains spaces and cannot be parsed by java.net.URI(String),
> which expects an already-escaped URI. That exception is catched internally,
> but namespace mangling and prepending of the servlet context path are omitted
> in that case.
> The use of java.net.URI is not good when it is about building URIs from
> plain, unescaped components, since it only really supports parsing of escaped
> uri strings and the multi-args constructor in conjunction with toString()
> simply behaves wrong. See also http://blog.limewire.org/?p=261
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.