[ 
https://issues.apache.org/jira/browse/SLING-1870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12930587#action_12930587
 ] 

Felix Meschberger commented on SLING-1870:
------------------------------------------

Actually it is up to the servlet container to decode the String:

    /**
     * Returns any extra path information associated with the URL the client
     * sent when it made this request. The extra path information follows the
     * servlet path but precedes the query string and will start with a "/"
     * character.
     *
     * <p>This method returns <code>null</code> if there was no extra path
     * information.
     *
     * <p>Same as the value of the CGI variable PATH_INFO.
     *
     * @return a <code>String</code>, decoded by the web container, specifying
     * extra path information that comes after the servlet path but before the
     * query string in the request URL; or <code>null</code> if the URL does
     * not have any extra path information
     */
    public String getPathInfo();


> Sling should url decode the request url before trying to resolve to a resource
> ------------------------------------------------------------------------------
>
>                 Key: SLING-1870
>                 URL: https://issues.apache.org/jira/browse/SLING-1870
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Clemens Wyss
>            Priority: Critical
>
> e.g.:
> JCR supports nodes with spaces (in its name), such as "Nice World". 
> When accessing this node in Sling, the request url would  look something like
> http://<sling host>/<path to node>/Nice%20World
> unfortunately we then try to resolve /<path to node>/Nice%20World in the 
> JcrResourceRersolver which, of course, does NOT match/resolve!
> Hence somewhere before resolving the resource we should URLDecoder.decode the 
> request URL ( request.getPathInfo() )
> Possible solution:
> SlingHttpServletRequest could provide
> public String getResourceLookupPath()
> {
>    return URLDecoder.decode( request.getPathInfo(), "UTF-8" ) );
> }
> This method could be used in RequestData#initResource and possibly other 
> places...
> public Resource initResource(ResourceResolver resourceResolver) {
> ...
> Resource resource = resourceResolver.resolve(request, 
> request.getResourceLookupPath() );
> ...
> Or is it up to the JcrResourceResolver to decode the URL it gets?

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

Reply via email to