initWithBaseURL
Fixes 446. If the URL passed into initWithBaseURL is a file URL rather than a directory URL we will fix it. Without this fix, if you provide "http://myhost/api" as a baseURL and try to get "path", AFNetworking will get http://myhost/path instead of http://myhost/api/path. With the fix, we'll change http://myhost/api to http://myhost/api/.
This commit is contained in:
parent
bff368c096
commit
f849627f9a
1 changed files with 3 additions and 0 deletions
|
|
@ -254,6 +254,9 @@ static NSString * AFPropertyListStringFromParameters(NSDictionary *parameters) {
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( [[url path] length] > 0 && ![[url absoluteString] hasSuffix: @"/"] ) {
|
||||||
|
url = [url URLByAppendingPathComponent: @""];
|
||||||
|
}
|
||||||
self.baseURL = url;
|
self.baseURL = url;
|
||||||
|
|
||||||
self.stringEncoding = NSUTF8StringEncoding;
|
self.stringEncoding = NSUTF8StringEncoding;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue