Merge pull request #5002 from ErisDS/issue-4989

Fixing overzealous trailing-slashes
This commit is contained in:
Matt Enlow 2015-03-09 10:34:18 -06:00
commit 46d1f812e6

View File

@ -128,8 +128,9 @@ NavigationController = Ember.Controller.extend({
url = match[1];
// if the last char is not a slash, then add one,
// as long as there is no # or . in the URL (anchor or file extension)
// this also handles the empty case for the homepage
if (url[url.length - 1] !== '/') {
if (url[url.length - 1] !== '/' && url.indexOf('#') === -1 && url.indexOf('.') === -1) {
url += '/';
}
} else if (!validator.isURL(url) && url !== '' && url[0] !== '/' && url.indexOf('mailto:') !== 0) {