Skip to content

Commit

Permalink
Correct request body length (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
odincov authored and cjus committed May 24, 2017
1 parent 85fb542 commit 980d7ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/server-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ServerRequest {
send(options) {
return new Promise((resolve, reject) => {
if (options.method === 'POST' || options.method === 'PUT') {
options.headers['content-length'] = options.body.length;
options.headers['content-length'] = Buffer.byteLength(options.body, 'utf8');
} else {
delete options.body;
}
Expand Down

0 comments on commit 980d7ff

Please sign in to comment.