Skip to content

Commit

Permalink
Prevent URL falling back to the root domain
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxsoft committed Aug 23, 2018
1 parent 493d490 commit 6d3f6bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion KeePassHTTPKit/Handlers/KPHHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ - (NSArray *)entriesForURL:(NSURL *)url {
/* if we got no scheme, host is nil as well so fall back to the full url string */
NSString *search = url.host ? url.host : url.absoluteString;
NSArray *entries = nil;
while (!entries || entries.count == 0) {
while ((!entries || entries.count == 0) && [search rangeOfString:@"."].length > 0) {
entries = [self delegateEntriesForURL:search];
NSRange dot = [search rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"."]];
if (dot.location == NSNotFound || dot.location + 1 >= search.length) {
Expand Down

0 comments on commit 6d3f6bf

Please sign in to comment.