Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Malformed NSURL's make phonegap integration difficult #67

Closed
robotony opened this Issue · 4 comments

4 participants

@robotony

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:
baseURL="http://something.uservoice.com"
_path = "/api/v1/client.json"

using stringByAppendingPathComponent results in
"http:/something.uservoice.com/api/v1/client.json"

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

@nforgetkabam

I just ran into this same issue.

@austintaylor

Fixed in 1.2.2

@nforgetkabam

Excellent. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.