Malformed NSURL's make phonegap integration difficult #67

robotony opened this Issue Aug 2, 2012 · 4 comments


None yet

4 participants

robotony commented Aug 2, 2012

All the URL's loaded by the sdk are malformed and return a null host name. When integrating into a PhoneGap app it's typical to restrict URL access in the app with a whitelist. But the whitelist can't work against a nil/null host. The issue is in the HTTPRiot source: HRRequestOperation.m, composedURL

[NSURL URLWithString:[[baseURL absoluteString] stringByAppendingPathComponent:_path]];

Constructing the URL in this manner results in a url with a single slash after the scheme, for example:
_path = "/api/v1/client.json"

using stringByAppendingPathComponent results in

Is you ask for the host from this NSURL you always get nil. I'd recommend not using stringByAppendingPathComponent to construct the URL.


I just ran into this same issue.


Fixed in 1.2.2


Excellent. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment