[
https://issues.apache.org/jira/browse/SLING-1209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783644#action_12783644
]
Carsten Ziegeler commented on SLING-1209:
-----------------------------------------
I've added a potential fix for the problems:
- for the first one, we simply check if the requested url is the empty path (no
trailing slash) and handle this separately
- for the second one I replaced the getting of the base path from the resource
path with the ResourcePathInfo.getResourcePath()
> Redirect Problems
> -----------------
>
> Key: SLING-1209
> URL: https://issues.apache.org/jira/browse/SLING-1209
> Project: Sling
> Issue Type: Bug
> Components: Servlets
> Affects Versions: Servlets Get 2.0.6
> Reporter: Carsten Ziegeler
> Assignee: Carsten Ziegeler
> Fix For: Servlets Get 2.0.8
>
> Attachments: sling1209.patch
>
>
> The current redirect servlet has two problems:
> - it always creates a relative redirect - this fails if the current request
> just targets the webapp context without a trailing slash - for example if the
> Sling web app is mounted at /a and "/a" is request, a redirect to
> "/index.html" is modified to a relative redirect "index.html" - which results
> in a redict to "/index.html" and not "/a/index.html"
> - the creation of the relative path uses the current resource of the request
> to create the path. However this path might not resemble the request path
> (due to mapping etc.) which might result in a wrong relative redirect.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.