From: Tom Hughes Date: Sat, 27 Apr 2013 11:20:16 +0000 (+0100) Subject: Encode parameters correctly when building an OAuth base string X-Git-Tag: live~5071 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/10161fb41b22286008c91507d7f0b0c7ee453537?ds=sidebyside Encode parameters correctly when building an OAuth base string Parameter key and value escaping needs to use the extended algorithm from the OAuth specification, not the standard URI escaping algorithm so we need to escape !, ', *, ( and ) characters. --- diff --git a/vendor/assets/ohauth/ohauth.js b/vendor/assets/ohauth/ohauth.js index 0497da87c..419fb2a1a 100644 --- a/vendor/assets/ohauth/ohauth.js +++ b/vendor/assets/ohauth/ohauth.js @@ -4,8 +4,8 @@ var ohauth = {}; ohauth.qsString = function(obj) { return Object.keys(obj).sort().map(function(key) { - return encodeURIComponent(key) + '=' + - encodeURIComponent(obj[key]); + return ohauth.percentEncode(key) + '=' + + ohauth.percentEncode(obj[key]); }).join('&'); };