You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2009/11/30 13:41:20 UTC

[jira] Created: (SLING-1209) Redirect Problems

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


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.


[jira] Commented: (SLING-1209) Redirect Problems

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Updated: (SLING-1209) Redirect Problems

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated SLING-1209:
------------------------------------

    Attachment: sling1209.patch

Potential fix

> 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.


[jira] Closed: (SLING-1209) Redirect Problems

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed SLING-1209.
-----------------------------------


> 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.


[jira] Resolved: (SLING-1209) Redirect Problems

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved SLING-1209.
-------------------------------------

    Resolution: Fixed

I've applied the suggested patch together with new junit tests.

> 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.