Permalink
Browse files

Match slash-less root routes.

  • Loading branch information...
fblee committed May 2, 2013
1 parent 3fcd9fe commit b28a3ffc6bfb73bded8c83d927ea334ee09ced4d
Showing with 5 additions and 0 deletions.
  1. +5 −0 js/lib/router.js
View
@@ -242,6 +242,11 @@ _.extend(History.prototype, /*Events,*/ {
window.history.replaceState({}, document.title, loc.protocol + '//' + loc.host + this.options.root + this.fragment);
}
+ // Workaround the root having a trailing slash when the visited URL is misisng it.
+ if (this._wantsPushState && this._hasPushState && this.options.root === ('/' + this.fragment + '/')) {
+ window.history.replaceState({}, document.title, loc.protocol + '//' + loc.host + this.options.root);
+ }
+
if (!this.options.silent) {
return this.loadUrl();
}

0 comments on commit b28a3ff

Please sign in to comment.