diff --git a/CHANGELOG.md b/CHANGELOG.md index e4e20d4..3cd616e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ + +# [3.1.0](https://github.com/fczbkk/UrlMatch/compare/v3.0.0...v3.1.0) (2016-07-17) + + +### Bug Fixes + +* assume path always ends with optional trailing slash if missing([0662e33](https://github.com/fczbkk/UrlMatch/commit/0662e33)) + + + # [3.0.0](https://github.com/fczbkk/UrlMatch/compare/v2.2.0...v3.0.0) (2016-05-31) diff --git a/lib/path.js b/lib/path.js index 08d5aac..2c68df1 100644 --- a/lib/path.js +++ b/lib/path.js @@ -36,6 +36,10 @@ var _class = function (_UrlPart) { key: 'sanitize_replacements', get: function get() { return [ + // add trailing slash if path is empty + { substring: /^$/, replacement: '\/' }, + // add trailing slash if path does not end with asterisk or trailing slash + { substring: /[^/*]$/, replacement: '$&\/' }, // assume trailing slash at the end of path is optional { substring: /\/$/, replacement: '\\/?' }, { substring: /\/\*$/, replacement: '((\/?)|\/*)' }, // allow letters, numbers, hyphens, dots, slashes and underscores diff --git a/package.json b/package.json index b9877e2..e93c510 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@fczbkk/url-match", "title": "UrlMatch", - "version": "3.0.0", + "version": "3.1.0", "description": "JavaScript object for matching URLs against patterns.", "repository": { "type": "git",