https://bz.apache.org/bugzilla/show_bug.cgi?id=58228

--- Comment #1 from Thomas Maslen <thomas.mpp.mas...@gmail.com> ---
With the caveat that I may not have thought this through...

If StandardRoot.validate(String) isn't going to change (i.e. it will continue
to throw IllegalArgumentException for paths that don't have a leading slash),
then perhaps one way to make GET_RESOURCE_REQUIRE_SLASH == false behave as
documented would be to doctor the offending path (i.e. prepend "/") before
passing it on.
Perhaps something roughly like:

Old:

        if (!path.startsWith("/") && GET_RESOURCE_REQUIRE_SLASH)
            return null;

New:

        if (!path.startsWith("/")) {
            if (GET_RESOURCE_REQUIRE_SLASH)
                return null;
            else
                path = "/" + path;
        }


The ApplicationContext.getResource(String) method might also need similar-ish
treatment.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to