-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
The NIOHTTPClient takes the host URL, and also an optional port number as arguments.
However, the URL is also able to have a port number in it, for example: https://server.example.com:8080.
It is important for anyone who is already using the port argument to continue to be able to set it, but if it isn't explicitly set, we should use the port number from the URL, if present.
Currently, the initializer sets the port like this:
self.port = port ?? (useSSL ? 443 : 80)
Checking if the host URL has a port should be able to be done like this:
self.port = port ?? baseURL.port ?? (useSSL ? 443 : 80)
This uses:
- The explicit port number, if present
- The port number from the URL, if present
- The default port (80 or 443)
zboralski
Metadata
Metadata
Assignees
Labels
No labels