Skip to content

Commit

Permalink
Document intention of hostURL.port conditional check.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcanizales committed Aug 6, 2015
1 parent 83b7971 commit cceeb51
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/objective-c/GRPCClient/private/GRPCHost.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ - (instancetype)initWithAddress:(NSString *)address {
if (![scheme isEqualToString:@"https"] && ![scheme isEqualToString:@"http"]) {
[NSException raise:NSInvalidArgumentException format:@"URL scheme %@ isn't supported.", scheme];
}
// If the user didn't specify a port (hostURL.port is nil), provide a default one.
NSNumber *port = hostURL.port ?: [scheme isEqualToString:@"https"] ? @443 : @80;
address = [@[hostURL.host, port] componentsJoinedByString:@":"];

Expand Down

0 comments on commit cceeb51

Please sign in to comment.