ranm8 / requestify

Simplifies node HTTP request making.
http://ranm8.github.io/requestify
MIT License
223 stars 55 forks source link

Incorrect content length when body contains unicode characters #42

Closed osuushi closed 8 years ago

osuushi commented 8 years ago

Because Request.prototype.getContentLength uses string.length, requestify breaks on unicode bodies. It looks like this is fixed in the 0.2.0 branch, which is not published to npm. Any timetable on that?

mutekinootoko commented 8 years ago

+1

niyarlatotep commented 8 years ago

+1

Alex-Werner commented 8 years ago

Hi. I came here as I had a struggle with requestify and international characters / accent. Sending : {interest:"Honoré De Balzac"} made my server reject HTTP400 the call (Invalid request payload JSON Format).

Changing line 252 of the file lib\request.js by : return Buffer.byteLength(this.getBody()); fixed the problem. After a little search I found that it was fixed in ... 2013 but not published. Why not ?

ranyitz commented 8 years ago

Hey @Alex-Werner ! I know it's a bit late but better late than never, version 0.2.0 will be published soon !

Alex-Werner commented 8 years ago

@ran-y That's a freaking good things to hear :D

ranm8 commented 8 years ago

Version 0.2.0 was released! feel free to update (-: Closing