Skip to content

Commit

Permalink
Return baseURL if path is nil in AFURLWithPathRelativeToURL
Browse files Browse the repository at this point in the history
  • Loading branch information
mattt committed Nov 2, 2011
1 parent f86ac98 commit eb79d53
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions AFNetworking/AFHTTPClient.m
Expand Up @@ -82,6 +82,10 @@ - (id)initWithStringEncoding:(NSStringEncoding)encoding;
}

static NSURL * AFURLWithPathRelativeToURL(NSString *path, NSURL *baseURL) {
if (!path) {
return baseURL;
}

NSURL *url = [baseURL URLByAppendingPathComponent:[path stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]]];
NSString *URLString = [url absoluteString];
if ([path hasSuffix:@"/"]) {
Expand Down

0 comments on commit eb79d53

Please sign in to comment.