You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Ian Clelland (JIRA)" <ji...@apache.org> on 2014/02/07 20:54:27 UTC

[jira] [Commented] (CB-5991) iOS whitelist fails to handle path prefixes ending with "/"

    [ 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)