Comparing version 1.2.1 to 1.2.2
@@ -35,9 +35,2 @@ "use strict"; | ||
function byte_length(s) { | ||
// http://stackoverflow.com/questions/5515869/string-length-in-bytes-in-javascript | ||
// Matches only the 10.. bytes that are non-initial characters in a multi-byte sequence. | ||
var m = encodeURIComponent(s).match(/%[89ABab]/g); | ||
return s.length + (m ? m.length : 0); | ||
} | ||
function hmac_sha256(payload, secret) { | ||
@@ -178,3 +171,3 @@ var hmac = crypto.createHmac('sha256', secret); | ||
var body = JSON.stringify(data); | ||
var body = new Buffer(JSON.stringify(data)); | ||
@@ -194,3 +187,3 @@ params = _.clone(params); | ||
'Content-Type': 'application/json', | ||
'Content-Length': byte_length(body) | ||
'Content-Length': body.length | ||
} | ||
@@ -208,3 +201,3 @@ ) | ||
req.write(body); | ||
req.write(body.toString()); | ||
req.end(); | ||
@@ -211,0 +204,0 @@ }; |
@@ -5,3 +5,3 @@ { | ||
"description": "YellowBot API wrapper", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"homepage": "https://github.com/solfo/node-yellowbot", | ||
@@ -8,0 +8,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12318
251