From 432dc3122f726d819a82280eaac7a70e2f16e7db Mon Sep 17 00:00:00 2001 From: Aaron Silverman Date: Fri, 7 Feb 2014 14:53:30 -0500 Subject: [PATCH] properly sign when payload includes ' or * --- lib/panda/api_authentication.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/panda/api_authentication.js b/lib/panda/api_authentication.js index fed02f5..01d411f 100644 --- a/lib/panda/api_authentication.js +++ b/lib/panda/api_authentication.js @@ -13,7 +13,12 @@ function canonicalString(params){ index.sort(); index.forEach(function(key) { - index2.push(key + "=" + encodeURIComponent(params[key]).replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/!/g, "%21")) + index2.push(key + "=" + encodeURIComponent(params[key]) + .replace(/\(/g, "%28") + .replace(/\)/g, "%29") + .replace(/!/g, "%21") + .replace(/'/g, "%27") + .replace(/\*/g, "%2A")) }); return index2.join("&");