From eddb0065c12bd0f3ac23e36147cba84e5a0755b5 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Mon, 23 Mar 2015 22:10:09 -0700 Subject: Fixes host transformation when user supplies a port. --- src/objective-c/GRPCClient/private/GRPCChannel.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.3