You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2015/08/10 01:49:12 UTC
[Bug 58228] ApplicationContext.GET_RESOURCE_REQUIRE_SLASH vs
StandardRoot.getResource(String)
https://bz.apache.org/bugzilla/show_bug.cgi?id=58228
--- Comment #1 from Thomas Maslen <th...@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org