diff options
Diffstat (limited to 'src/Angular.js')
| -rw-r--r-- | src/Angular.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Angular.js b/src/Angular.js index 6e5786ec..2d4b1671 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -853,6 +853,23 @@ function toKeyValue(obj) { return parts.length ? parts.join('&') : ''; } + +/** + * we need our custom mehtod because encodeURIComponent is too agressive and doesn't follow + * http://www.ietf.org/rfc/rfc2396.txt with regards to the character set (pchar) allowed in path + * segments + */ +function encodeUriSegment(val) { + return encodeURIComponent(val). + replace(/%40/gi, '@'). + replace(/%3A/gi, ':'). + replace(/%26/gi, '&'). + replace(/%3D/gi, '='). + replace(/%2B/gi, '+'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','); +} + /** * @workInProgress * @ngdoc directive |
