aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jorge Canizales <jcanizales@google.com>2015-08-06 16:51:44 -0700
committerGravatar Jorge Canizales <jcanizales@google.com>2015-08-06 16:51:44 -0700
commit015ab35a2875059c9047de2286c22c96a01628cb (patch)
tree954143044a69c480557dd7fb99772d3f60407868
parent55fcf504b9d5da7c4144a0d2a60bea748a1d8757 (diff)
Clarify intention of the code that adds a default port
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m
index 14bde92d98..6636c48620 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.m
+++ b/src/objective-c/GRPCClient/private/GRPCHost.m
@@ -58,8 +58,10 @@
// Default initializer.
- (instancetype)initWithAddress:(NSString *)address {
- // To provide a default port, we try to interpret the address.
- // TODO(jcanizales): Add unit tests for the types of addresses we want to let pass through.
+ // To provide a default port, we try to interpret the address. If it's just a host name without
+ // scheme and without port, we'll use port 443. If it has a scheme, we pass it untouched to the C
+ // gRPC library.
+ // TODO(jcanizales): Add unit tests for the types of addresses we want to let pass untouched.
NSURL *hostURL = [NSURL URLWithString:[@"https://" stringByAppendingString:address]];
if (hostURL && !hostURL.port) {
address = [hostURL.host stringByAppendingString:@":443"];