From 676cba3b1d6dc5d9bd2f98e3989c8e9fb611d9da Mon Sep 17 00:00:00 2001 From: Moritz Pein Date: Tue, 10 Apr 2018 07:09:38 +0200 Subject: [PATCH] only set content-type header if there is content --- lib/figo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/figo.js b/lib/figo.js index 3082a77..46e89bd 100644 --- a/lib/figo.js +++ b/lib/figo.js @@ -267,10 +267,10 @@ var queryWithRetries = function (agent, authorization, contentType, path, data, if (data) { data = stringify(clean(data)); + agent.figo_request.setHeader("Content-Type", contentType); } agent.figo_request.setHeader("Authorization", authorization); - agent.figo_request.setHeader("Content-Type", contentType); agent.figo_request.setHeader("Content-Length", (data ? Buffer.byteLength(data) : 0)); if (data)