[Issue #72] More fixes to construction of URL from relative path, preventing scheme from incorrectly changing :// to :/
This commit is contained in:
parent
68ef25cb7c
commit
3040aafee9
@ -82,11 +82,12 @@ static NSString * AFBase64EncodedStringFromString(NSString *string) {
|
||||
}
|
||||
|
||||
static NSURL * AFURLWithPathRelativeToURL(NSString *path, NSURL *baseURL) {
|
||||
NSString *URLString = [[baseURL absoluteString] stringByAppendingPathComponent:path];
|
||||
NSURL *url = [baseURL URLByAppendingPathComponent:[path stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]]];
|
||||
NSString *URLString = [url absoluteString];
|
||||
if ([path hasSuffix:@"/"]) {
|
||||
URLString = [URLString stringByAppendingString:@"/"];
|
||||
}
|
||||
|
||||
|
||||
return [NSURL URLWithString:URLString];
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user