mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Normalize the path pattern instead of throwing an assertion
This commit is contained in:
@@ -125,6 +125,6 @@ NSString *RKPathNormalize(NSString *path)
|
||||
path = [path stringByReplacingOccurrencesOfString:@"//" withString:@"/"];
|
||||
NSUInteger length = [path length];
|
||||
if ([path characterAtIndex:length - 1] == '/') path = [path substringToIndex:length - 1];
|
||||
if ([path characterAtIndex:0] != '/') path = [@"/" stringByAppendingString:path];
|
||||
if ([path characterAtIndex:0] != '/') path = [NSString stringWithFormat:@"/%@", path];
|
||||
return path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user