From d9d8d5a106e4da75f762a833af51ae920b796064 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 29 Apr 2013 10:49:19 +0100 Subject: [PATCH 1/1] Handle empty arguments when computing the OAuth base string --- vendor/assets/ohauth/ohauth.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vendor/assets/ohauth/ohauth.js b/vendor/assets/ohauth/ohauth.js index 210e859e4..73eb8b9ee 100644 --- a/vendor/assets/ohauth/ohauth.js +++ b/vendor/assets/ohauth/ohauth.js @@ -16,7 +16,9 @@ ohauth.qsString = function(obj) { }; ohauth.stringQs = function(str) { - return str.split('&').reduce(function(obj, pair){ + return str.split('&').filter(function (pair) { + return pair !== ''; + }).reduce(function(obj, pair){ var parts = pair.split('='); obj[decodeURIComponent(parts[0])] = (null === parts[1]) ? '' : decodeURIComponent(parts[1]); -- 2.43.2