[ 
https://issues.apache.org/jira/browse/WW-4187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13925545#comment-13925545
 ] 

ASF GitHub Bot commented on WW-4187:
------------------------------------

GitHub user lukaszlenart opened a pull request:

    https://github.com/apache/struts/pull/4

    WW-4187 correctly identify protocols to recognise if URL is path

    This is related to [WW-4187](https://issues.apache.org/jira/browse/WW-4187)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/struts 
feature/WW-4187-correctly-identify-protocols

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/struts/pull/4.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4
    
----
commit 4b7d2e35d09225a7c8b3b410588131b692b2730f
Author: Lukasz Lenart <lukaszlen...@apache.org>
Date:   2014-03-09T20:46:33Z

    Uses URL class to check if location is path or full url

commit 1ca55b8a79cc118128391bddd3b776024def79f8
Author: Lukasz Lenart <lukaszlen...@apache.org>
Date:   2014-03-09T20:57:58Z

    Extends logic how protocol part of url is extracted

----


> ServletRedirectResult only works with a limited set of hardcoded URL protocols
> ------------------------------------------------------------------------------
>
>                 Key: WW-4187
>                 URL: https://issues.apache.org/jira/browse/WW-4187
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.3.7, 2.3.8, 2.3.12, 2.3.14, 2.3.14.1, 2.3.14.2, 
> 2.3.14.3, 2.3.15.1
>            Reporter: Michiel Toneman
>             Fix For: 2.3.17
>
>
> The isPathUrl(String url) implementation was changed from:
> {code:java}
> return (url.indexOf(':') == -1);
> {code}
> to:
> {code:java}
> return !url.startsWith("http:")
>                 && !url.startsWith("https:")
>                 && !url.startsWith("mailto:";)
>                 && !url.startsWith("file:")
>                 && !url.startsWith("ftp:");
> {code}
> This breaks integrations which require a redirect in (e.g.) a mobile app for 
> iOS which often use custom protocols such as myapp:// 
> There are also numerous valid / common protocols which are not in this list.
> The result of this change is that redirects to such URLs are treated as local 
> redirects (paths), rather than absolute redirects.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to