fix(ngRoute): remove unnecessary call to decodeURIComponent

Since `$location.$$path` is already decoded, doing an extra `decodeURIComponent` is both unnecessary
and can cause problems. Specifically, if the path originally includes an encoded `%` (aka `%25`),
then ngRoute will throw "URIError: URI malformed".

Closes #6326
Closes #6327
This commit is contained in:
Jason Miller
2014-02-18 16:26:00 -07:00
committed by Peter Bacon Darwin
parent 49b2a1c8cf
commit 1b779028fd
2 changed files with 4 additions and 6 deletions

View File

@@ -468,9 +468,7 @@ function $RouteProvider(){
for (var i = 1, len = m.length; i < len; ++i) {
var key = keys[i - 1];
var val = 'string' == typeof m[i]
? decodeURIComponent(m[i])
: m[i];
var val = m[i];
if (key && val) {
params[key.name] = val;