From 9f690e7daf69c884ea31a7dc2cfd46604066e2df Mon Sep 17 00:00:00 2001 From: Travis Glenn Hansen Date: Mon, 29 Nov 2021 01:21:52 -0700 Subject: [PATCH] defaults for freenas protocol Signed-off-by: Travis Glenn Hansen --- src/driver/freenas/http/index.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/driver/freenas/http/index.js b/src/driver/freenas/http/index.js index 44ffa33..c77650d 100644 --- a/src/driver/freenas/http/index.js +++ b/src/driver/freenas/http/index.js @@ -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,