Skip to content

Commit

Permalink
Fix route components parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Elethom Hunter committed Dec 23, 2014
1 parent 9ec325f commit 0cdf01b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions HHRouter/HHRouter.m
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ - (NSMutableDictionary*)routes
- (NSArray*)pathComponentsFromRoute:(NSString*)route
{
NSMutableArray *pathComponents = [NSMutableArray array];
for (NSString *pathComponent in [[NSURL URLWithString:route] pathComponents]) {
for (NSString *pathComponent in route.pathComponents) {
if ([pathComponent isEqualToString:@"/"]) continue;
if ([[pathComponent substringToIndex:1] isEqualToString:@"?"]) break;
[pathComponents addObject:pathComponent];
Expand Down Expand Up @@ -245,4 +245,5 @@ - (NSDictionary*)params
return objc_getAssociatedObject(self, &kAssociatedParamsObjectKey);
}

@end
@end

0 comments on commit 0cdf01b

Please sign in to comment.