incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shazron Abdullah (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-942) iOS failing FileTransfer malformed URL tests
Date Wed, 20 Jun 2012 20:52:42 GMT

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

Shazron Abdullah commented on CB-942:
-------------------------------------

NSURL reports these as VALID:

# httpssssssss://ex%20ample.
# httpssssssss://example.com

NSURL reports these as  INVALID:
 
# httpssssssss://ex ample.com (note the unescaped space)

The real fix is to only escape the path part of the URL.
                
> iOS failing FileTransfer malformed URL tests
> --------------------------------------------
>
>                 Key: CB-942
>                 URL: https://issues.apache.org/jira/browse/CB-942
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.9.0
>            Reporter: Becky Gibson
>            Assignee: Shazron Abdullah
>             Fix For: 1.9.0
>
>
> FileTransfer tests were recently updated to test for malformed URLs in upload and download.
 iOS is failing those tests as it is returning a bad connection error rather than a bad URL
error.  
> The URL being tested is:  httpssss://ex ample.com (note the space between the x and a
in example).
> iOS creates the URL for the file transfer by escaping the url string passed in.  Thus,
the space gets escaped and the call to create the URL works and a valid URL is created:
>     NSURL *url = [NSURL URLWithString:[server stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
> iOS catches the error when it actually tries to communicate with the server and returns
the connection error.
> This can be fixed by not escaping the string or NOT escaping the entire string when creating
the URL.   Also, should httpssss:// fail?  The docs indicate the the 
> [NSURL urlWithString] api does test against the spec and will return nil if the url created
is not valid:  
> "Must be a URL that conforms to RFC 2396. This method parses URLString according to RFCs
1738 and 1808. " and "An NSURL object initialized with URLString. If the string was malformed,
returns nil."

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message