aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Jorge Canizales <jcanizales@google.com>2015-03-23 22:10:09 -0700
committerGravatar Jorge Canizales <jcanizales@google.com>2015-04-21 18:29:47 -0700
commiteddb0065c12bd0f3ac23e36147cba84e5a0755b5 (patch)
tree1417d95c3237eef501da3b1e35b6d61f17cc2cd3 /src
parentf1bda85ad9149d4b7f06f1c5635361d3d610b897 (diff)
Fixes host transformation when user supplies a port.
Diffstat (limited to 'src')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannel.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCChannel.m b/src/objective-c/GRPCClient/private/GRPCChannel.m
index 2107685d85..8b7055815d 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannel.m
+++ b/src/objective-c/GRPCClient/private/GRPCChannel.m
@@ -59,11 +59,11 @@
[NSException raise:NSInvalidArgumentException format:@"Invalid URL: %@", host];
}
if ([hostURL.scheme isEqualToString:@"https"]) {
- host = [hostURL.host stringByAppendingString:hostURL.port.stringValue ?: @":443"];
+ host = [@[hostURL.host, hostURL.port ?: @443] componentsJoinedByString:@":"];
return [[GRPCSecureChannel alloc] initWithHost:host];
}
if ([hostURL.scheme isEqualToString:@"http"]) {
- host = [hostURL.host stringByAppendingString:hostURL.port.stringValue ?: @":80"];
+ host = [@[hostURL.host, hostURL.port ?: @80] componentsJoinedByString:@":"];
return [[GRPCUnsecuredChannel alloc] initWithHost:host];
}
[NSException raise:NSInvalidArgumentException