[ http://issues.apache.org/jira/browse/TOMAHAWK-660?page=all ]

Martin Marinschek resolved TOMAHAWK-660.
----------------------------------------

    Fix Version/s: 1.1.5-SNAPSHOT
       Resolution: Fixed
         Assignee: Martin Marinschek

Tried to fix this with:

        //fix for TOMAHAWK-660; to be sure this fix is backwards compatible, the
        //encoded context-path is only used as a first option to check for the 
prefix
        //if we're sure this works for all cases, we can directly return the 
first value
        //and not double-check.
        try
        {
            
if(request.getRequestURI().startsWith(URLEncoder.encode(path,"UTF-8")))
                return true;
        }
        catch (UnsupportedEncodingException e)
        {
            log.error("Unsupported encoding UTF-8 used",e);

        }

        return request.getRequestURI().startsWith(path);

in both StreamingAddResource and DefaultAddResource.

regards,

Martin

> resources fail in web apps with spaces in context path
> ------------------------------------------------------
>
>                 Key: TOMAHAWK-660
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-660
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.4-SNAPSHOT, 1.1.3
>         Environment: JBoss 4.0.4 with embedded Tomcat
>            Reporter: Dan Osterrath
>         Assigned To: Martin Marinschek
>            Priority: Minor
>             Fix For: 1.1.5-SNAPSHOT
>
>
> In the method
> public boolean 
> org.apache.myfaces.component.html.util.StreamingAddResource.isResourceUri(HttpServletRequest
>  request)
> is a bug that makes the resource filter failing when the context path 
> contains a space (or probably other special characters).
> In lines 715ff the absolute path for the resources is beeing build up 
> starting with the context path for the web application. In my case the web 
> application has the context path "/test app" therefore the resource path is 
> "/test app/faces/myFacesExtensionResource".
> In line 724 the request uri is being checked if it starts with this this 
> path. Unfortunately the request uri is 
> "/test%20app/faces/myFacesExtensionResource/someresourcehere". (see the url 
> encoded space)
> Therefore the filter fails and no resources can be downloaded. The only 
> workaround is to use a context path without special characters.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to