Closed
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest versions of Parse Server and the Parse ObjC SDK.
Issue Description
This is a failing test, setting the server url has a check for a valid url that doesn't work in later SDK versions. It should be improved or removed.
Steps to reproduce
- (void)setServer:(NSString *)server {
PFParameterAssert(server.length, @"Server should not be `nil`.");
PFParameterAssert([NSURL URLWithString:server], @"Server should be a valid URL.");
_server = [server copy];
}
- (void)testServerValidation {
[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> _Nonnull configuration) {
configuration.applicationId = @"a";
configuration.clientKey = @"b";
PFAssertThrowsInvalidArgumentException(configuration.server = @"");
PFAssertThrowsInvalidArgumentException(configuration.server = @"Yolo Yarr"); // fails
}];
}
[NSURL URLWithString:@"Yolo Yarr"] // this is valid as URLWithString encodes the url instead of throwing an error in later SDK versions.
// Yolo%20Yarr
Solution
Try this, something similar or remove the check entirely
NSURL *url = [NSURL URLWithString:server];
PFParameterAssert(url && url.scheme && url.host, @"Server should be a valid URL.");