aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Muxi Yan <muxi@users.noreply.github.com>2019-01-10 10:22:30 -0800
committerGravatar GitHub <noreply@github.com>2019-01-10 10:22:30 -0800
commit18c48f68763adb944964d11525156aa6c1ee5ff3 (patch)
tree5db4cbdb727c709bd3607bffe37b03da585fbaf9
parent412c44992b187e9d749bb040b78fd74d32513d61 (diff)
parentc059946a75cab05a38dfb0c93afdbc0ee824d3a3 (diff)
Merge pull request #17683 from muxi/host-slash-remove
Remove hostname trailing slash
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannelPool.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCChannelPool.m b/src/objective-c/GRPCClient/private/GRPCChannelPool.m
index a323f0490c..60a33eda82 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannelPool.m
+++ b/src/objective-c/GRPCClient/private/GRPCChannelPool.m
@@ -236,6 +236,12 @@ static const NSTimeInterval kDefaultChannelDestroyDelay = 30;
return nil;
}
+ // remove trailing slash of hostname
+ NSURL *hostURL = [NSURL URLWithString:[@"https://" stringByAppendingString:host]];
+ if (hostURL.host && hostURL.port == nil) {
+ host = [hostURL.host stringByAppendingString:@":443"];
+ }
+
GRPCPooledChannel *pooledChannel = nil;
GRPCChannelConfiguration *configuration =
[[GRPCChannelConfiguration alloc] initWithHost:host callOptions:callOptions];