From 4f819ad7035608937b3e76542a4022ff5327a3b4 Mon Sep 17 00:00:00 2001 From: Gregor Date: Sat, 25 Nov 2017 22:08:26 -0800 Subject: [PATCH] fix: calculate content-length correctly for raw markdown request --- lib/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 99eb1102..cd818138 100644 --- a/lib/index.js +++ b/lib/index.js @@ -682,7 +682,9 @@ var Client = module.exports = function (config) { if (hasBody) { if (format === 'json') { query = JSON.stringify(query) - } else if (format !== 'raw') { + } else if (format === 'raw') { + query = msg.data + } else { query = query.join('&') } headers['content-length'] = Buffer.byteLength(query || '', 'utf8')