Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More UTF8 friendly content-length with Buffer.byteLength()

  • Loading branch information...
commit bf39b18763e1bad882dbc8aa7458072584f333bb 1 parent 94940e1
@slaskis slaskis authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/schemes/http.js
View
2  lib/schemes/http.js
@@ -47,7 +47,7 @@ module.exports = function http(uri,opts,output){
// Body Content-Length
if( typeof opts.body == "string" || Buffer.isBuffer( opts.body ) )
- uri.headers["content-length"] = opts.body.length;
+ uri.headers["content-length"] = Buffer.byteLength(opts.body);
var req = require(uri.scheme).request(uri,function(res){
// Follow Redirects
Please sign in to comment.
Something went wrong with that request. Please try again.