-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
Regarding FirebaseDatabase.
In the referenced line:
[url stringByReplacingOccurrencesOfString:originalPathString |
it appears as if the host may be corrupted in case the path is a substring of the host.
For instance:
- (void)testUrlParsedWithPathPartOfHost {
FParsedUrl *parsedUrl = [FUtilities parseUrl:@"https://sample.firebaseio.com/a"];
XCTAssertEqualObjects(parsedUrl.repoInfo.host, @"sample.firebaseio.com");
XCTAssertEqualObjects(parsedUrl.repoInfo.namespace, @"sample");
XCTAssertTrue(parsedUrl.repoInfo.secure);
XCTAssertEqualObjects(parsedUrl.path, [FPath pathWithString:@"a"]);
}
Since 'a' is part of 'sample', it will replace it with 'smple'.
This could be an issue in the API: FIRDatabaseReference referenceFromURL:
that parses a user-supplied URL.