Skip to content
Snippets Groups Projects
Commit 015ab35a authored by Jorge Canizales's avatar Jorge Canizales
Browse files

Clarify intention of the code that adds a default port

parent 55fcf504
No related branches found
No related tags found
No related merge requests found
......@@ -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"];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment