Skip to content

Commit

Permalink
Merge pull request #5 from AndrewBarba/master
Browse files Browse the repository at this point in the history
Use correct-content type when GET-ing a media/ path
  • Loading branch information
tykarol authored Jul 23, 2019
2 parents f20d092 + f74c8ec commit f6ecd6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f6ecd6a

Please sign in to comment.