wrong content-length with accentuated characters
kapouer opened this issue · comments
Hi,
this will eat the last char of the stringified request body :
shred.put({
url: someurl,
content: {
test: "testé"
},
headers: {
accept: "application/json",
content_type: "application/json"
}
});
Because (new Buffer('testé')).length == 6 and 'testé'.length == 5
A crude fix is replacing in content.js
get: function() { return this.body.length; }
by
get: function() { return new Buffer(this.body).length; }
Regards.