Skip to content

Commit

Permalink
fix: calculate content-length correctly for raw markdown request
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Nov 26, 2017
1 parent 46049aa commit 4f819ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/index.js
Expand Up @@ -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')
Expand Down

0 comments on commit 4f819ad

Please sign in to comment.