Skip to content

Commit

Permalink
fix: Parse.setServer doesn't properly validate URL (#1844)
Browse files Browse the repository at this point in the history
  • Loading branch information
dplewis authored Jan 31, 2025
1 parent e947529 commit d7b1c8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@
<Test
Identifier = "ParseClientConfigurationTests/testExtensionDataSharing">
</Test>
<Test
Identifier = "ParseClientConfigurationTests/testServerValidation">
</Test>
</SkippedTests>
</TestableReference>
</Testables>
Expand Down
3 changes: 2 additions & 1 deletion Parse/Parse/Source/ParseClientConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ - (void)setClientKey:(NSString *)clientKey {
}

- (void)setServer:(NSString *)server {
NSURL *url = [NSURL URLWithString:server];
PFParameterAssert(server.length, @"Server should not be `nil`.");
PFParameterAssert([NSURL URLWithString:server], @"Server should be a valid URL.");
PFParameterAssert(url && url.scheme && url.host, @"Server should be a valid URL.");
_server = [server copy];
}

Expand Down

0 comments on commit d7b1c8e

Please sign in to comment.