Skip to content

Commit 7e543a4

Browse files
author
Caleb Kniffen
committed
fix(urlMatcherFactory): Slashes are now properly decoded in url params
Closes: angular-ui#1973, angular-ui#1645
1 parent dba25db commit 7e543a4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/urlMatcherFactory.js

+3
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,9 @@ function $UrlMatcherFactory() {
579579
// TODO: in 1.0, make string .is() return false if value is undefined/null by default.
580580
// In 0.2.x, string params are optional by default for backwards compat
581581
is: function(val) { return val == null || !isDefined(val) || typeof val === "string"; },
582+
$normalize: function(val){
583+
return this.decode(val);
584+
},
582585
pattern: /[^/]*/
583586
},
584587
int: {

test/urlMatcherFactorySpec.js

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ describe("UrlMatcher", function () {
6565
var matcher = new UrlMatcher('/:foo');
6666
expect(matcher.format({ foo: "/" })).toBe('/%252F');
6767
expect(matcher.format({ foo: "//" })).toBe('/%252F%252F');
68+
expect(matcher.exec('/%2F').foo).toBe('/');
69+
expect(matcher.exec('/%2F%2F').foo).toBe('//');
6870
});
6971

7072
describe("snake-case parameters", function() {

0 commit comments

Comments
 (0)