Fix bug where remote host's trailing slash is not removed, causing name resolution failure

pull/17683/head
Muxi Yan 6 years ago
parent 302e7b4d2b
commit c059946a75
  1. 6
      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];

Loading…
Cancel
Save