Closed
Description
Regarding FirebaseDatabase.
In the referenced line:
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.