defaults for freenas protocol

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen 2021-11-29 01:21:52 -07:00
parent 3ab4023678
commit 9f690e7daf
1 changed files with 14 additions and 0 deletions

View File

@ -14,6 +14,20 @@ class Client {
}
getBaseURL() {
const server = this.options;
if (!server.protocol) {
if (server.port) {
if (String(server.port).includes("80")) {
server.protocol = "http";
}
if (String(server.port).includes("443")) {
server.protocol = "https";
}
}
}
if (!server.protocol) {
server.protocol = "http";
}
const options = {
scheme: server.protocol,
host: server.host,