Dirk Tschentscher created SLING-13433:
-----------------------------------------
Summary: Resolve mapped paths with a leading double slash
Key: SLING-13433
URL: https://issues.apache.org/jira/browse/SLING-13433
Project: Sling
Issue Type: Bug
Components: ResourceResolver
Affects Versions: Resource Resolver 1.12.18, Resource Resolver 1.12.20
Reporter: Dirk Tschentscher
We're facing a regression with static Servlets and a mapping where a
sling:internalRedirect is "/".
It gives a mapped path like //bin/foo.json.
SLING-13265 or Resource Resolver 1.12.18 changed the {{drill down into the
resource tree to find a match}} in
{{{}ResourceResolverImpl.resolveInternal{}}}. It gets the remaining path with
{{{}absPath.substring(resource.getPath().length()){}}}, which is off by one for
such a path, so the lookup used a wrong child name and the request ended up as
a NonExistingResource.
The same commit added a fix for double slashes at the top of
{{{}resolveInternal{}}}: "replace multiple slashes with single slashes to
support paths like e.g. //bin/browser.html".
But it only normalizes the incoming request path. The candidate paths built
from {{/etc/map}} are not normalized.
Workaround is to add another mapping with sling:internalRedirect: "/bin" before
.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)