defaults for freenas protocol
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
parent
3ab4023678
commit
9f690e7daf
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue