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

Document intention of hostURL.port conditional check.

parent 83b7971c
No related branches found
No related tags found
No related merge requests found
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
if (![scheme isEqualToString:@"https"] && ![scheme isEqualToString:@"http"]) { if (![scheme isEqualToString:@"https"] && ![scheme isEqualToString:@"http"]) {
[NSException raise:NSInvalidArgumentException format:@"URL scheme %@ isn't supported.", scheme]; [NSException raise:NSInvalidArgumentException format:@"URL scheme %@ isn't supported.", scheme];
} }
// If the user didn't specify a port (hostURL.port is nil), provide a default one.
NSNumber *port = hostURL.port ?: [scheme isEqualToString:@"https"] ? @443 : @80; NSNumber *port = hostURL.port ?: [scheme isEqualToString:@"https"] ? @443 : @80;
address = [@[hostURL.host, port] componentsJoinedByString:@":"]; address = [@[hostURL.host, port] componentsJoinedByString:@":"];
......
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