cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Clelland (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-5991) iOS whitelist fails to handle path prefixes ending with "/"
Date Fri, 07 Feb 2014 19:54:27 GMT

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

Ian Clelland commented on CB-5991:
----------------------------------

I'm fixing this by patching the regex on initialization.

So, a path like "{{/foo/*}}", which was previously translated into the regular expression
{code}
^\/foo\/.*$
{code}
will now be translated to
{code}
^\/foo(\/.*)?$
{code}
(essentially, the last "/" has been made optional, but if it is left off, then the path must
end there. So "{{/foo}}" will match, and "{{/foo/bar}}" will match, but "{{/foobar}}" will
not.

> iOS whitelist fails to handle path prefixes ending with "/"
> -----------------------------------------------------------
>
>                 Key: CB-5991
>                 URL: https://issues.apache.org/jira/browse/CB-5991
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>            Reporter: Ian Clelland
>            Assignee: Ian Clelland
>
> On iOS, NSURL will strip a trailing "/" from a URL when requesting the path component.
> This means that a whitelist which includes a URL pattern like "{{http://www.adobe.org/foo/*}}"
will incorrectly fail to match the URL "{{http://www.adobe.org/foo/}}", because NSURL will
claim that the path component is "{{/foo}}" and not "{{/foo/}}".



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message