Comparing version 1.2.0 to 1.2.1
@@ -35,2 +35,9 @@ "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) { | ||
@@ -186,3 +193,3 @@ var hmac = crypto.createHmac('sha256', secret); | ||
'Content-Type': 'application/json', | ||
'Content-Length': body.length | ||
'Content-Length': byte_length(body) | ||
} | ||
@@ -213,3 +220,2 @@ ) | ||
if (typeof v === 'object') { | ||
console.log("setting up file object for", k); | ||
has_files = true; | ||
@@ -216,0 +222,0 @@ p[k] = rest.file( v.path, null, null, null, 'image/png' ); |
@@ -5,3 +5,3 @@ { | ||
"description": "YellowBot API wrapper", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"homepage": "https://github.com/solfo/node-yellowbot", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -11,3 +11,3 @@ # node-yellowbot.js - node.js yellowbot API | ||
var api = require('yellowbot')(api_key); | ||
var api = require('yellowbot'); | ||
api.configure( { api_key: "abcd1234", api_secret: "def0" } ); | ||
@@ -14,0 +14,0 @@ |
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
12528
257