diff --git a/modules/helpers/Path.js b/modules/helpers/Path.js index deefa95c7b..1a72a86dc1 100644 --- a/modules/helpers/Path.js +++ b/modules/helpers/Path.js @@ -22,7 +22,7 @@ function compilePattern(pattern) { var source = pattern.replace(paramMatcher, function (match, pathSegment) { paramNames.push(getParamName(pathSegment)); - return pathSegment === '*' ? '(.*?)' : '([^./?#]+)'; + return pathSegment === '*' ? '(.*?)' : '([^/?#]+)'; }); compiled.matcher = new RegExp('^' + source + '$', 'i'); diff --git a/specs/Path.spec.js b/specs/Path.spec.js index 0c2bf6ca7d..9bbf226274 100644 --- a/specs/Path.spec.js +++ b/specs/Path.spec.js @@ -32,6 +32,12 @@ describe('Path.extractParams', function () { expect(Path.extractParams(pattern, 'users/123')).toBe(null); }); }); + + describe('and the path matches with a segment containing a .', function () { + it('returns an object with the params', function () { + expect(Path.extractParams(pattern, 'comments/foo.bar/edit')).toEqual({ id: 'foo.bar' }); + }); + }); }); describe('when a pattern has characters that have special URL encoding', function () {