From 0e3f97877ba944786fc3f9fd7e233ebb6771495d Mon Sep 17 00:00:00 2001 From: Travis Glenn Hansen Date: Mon, 2 Dec 2019 17:09:12 -0700 Subject: [PATCH] force content-type in FreeNAS http requests --- src/driver/freenas/http/index.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/driver/freenas/http/index.js b/src/driver/freenas/http/index.js index 01f5525..62c0685 100644 --- a/src/driver/freenas/http/index.js +++ b/src/driver/freenas/http/index.js @@ -53,8 +53,9 @@ class Client { method: "GET", url: this.getBaseURL() + endpoint, headers: { - Accept: "*/*", - "User-Agent": USER_AGENT + Accept: "application/json", + "User-Agent": USER_AGENT, + "Content-Type": "application/json" }, json: true, qs: data, @@ -84,8 +85,9 @@ class Client { method: "POST", url: this.getBaseURL() + endpoint, headers: { - Accept: "*/*", - "User-Agent": USER_AGENT + Accept: "application/json", + "User-Agent": USER_AGENT, + "Content-Type": "application/json" }, json: true, body: data, @@ -115,8 +117,9 @@ class Client { method: "PUT", url: this.getBaseURL() + endpoint, headers: { - Accept: "*/*", - "User-Agent": USER_AGENT + Accept: "application/json", + "User-Agent": USER_AGENT, + "Content-Type": "application/json" }, json: true, body: data, @@ -146,8 +149,9 @@ class Client { method: "DELETE", url: this.getBaseURL() + endpoint, headers: { - Accept: "*/*", - "User-Agent": USER_AGENT + Accept: "application/json", + "User-Agent": USER_AGENT, + "Content-Type": "application/json" }, json: true, body: data,