From f74c8ecc9cdbef0c810f6c8fc5b240398e569ef1 Mon Sep 17 00:00:00 2001 From: Andrew Barba Date: Thu, 2 May 2019 16:17:41 -0400 Subject: [PATCH] Use correct-content type when GET-ing a media/ path --- lib/twitter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/twitter.js b/lib/twitter.js index 9540857e..217a72ce 100644 --- a/lib/twitter.js +++ b/lib/twitter.js @@ -251,7 +251,7 @@ Twitter.prototype._buildReqOpts = function (method, path, params, isStreaming, c reqOpts.url = endpoints.REST_ROOT + path + '.json'; } - if (FORMDATA_PATHS.indexOf(path) !== -1) { + if (FORMDATA_PATHS.indexOf(path) !== -1 && method === 'POST') { reqOpts.headers['Content-type'] = 'multipart/form-data'; reqOpts.form = finalParams; // set finalParams to empty object so we don't append a query string