From 288b69a314e9bd14458b6647532eb62aad5c5cdf Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Thu, 14 Feb 2013 14:39:55 -0800 Subject: fix($http): do not encode special characters `@$:,` in params encodeURIComponent is too aggressive and doesn't follow http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path segments so we need this test to make sure that we don't over-encode the params and break stuff like buzz api which uses @self. This is has already been fixed in `$resource`. This commit fixes it in a same way for `$http` as well. BREAKING CHANGE: $http does follow RFC3986 and does not encode special characters like `$@,:` in params. If your application needs to encode these characters, encode them manually, before sending the request. --- src/ng/http.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ng/http.js') diff --git a/src/ng/http.js b/src/ng/http.js index 65d2ee5d..4288e7c1 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -818,8 +818,8 @@ function $HttpProvider() { if (isObject(v)) { v = toJson(v); } - parts.push(encodeURIComponent(key) + '=' + - encodeURIComponent(v)); + parts.push(encodeUriQuery(key) + '=' + + encodeUriQuery(v)); }); }); return url + ((url.indexOf('?') == -1) ? '?' : '&') + parts.join('&'); -- cgit v1.2.3