mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
Leave out unnecessary trailing slash.
This commit is contained in:
@@ -1481,7 +1481,8 @@
|
||||
// If we've started off with a route from a `pushState`-enabled
|
||||
// browser, but we're currently in a browser that doesn't support it...
|
||||
if (!this._hasPushState && !this.atRoot()) {
|
||||
this.location.replace(this.root + '#' + this.getPath());
|
||||
var root = this.root.slice(0, -1) || '/';
|
||||
this.location.replace(root + '#' + this.getPath());
|
||||
// Return immediately as browser will do redirect to new url
|
||||
return true;
|
||||
|
||||
|
||||
@@ -565,7 +565,7 @@
|
||||
Backbone.history.stop();
|
||||
location.replace('http://example.com/root/x/y?a=b');
|
||||
location.replace = function(url) {
|
||||
strictEqual(url, '/root/#x/y?a=b');
|
||||
strictEqual(url, '/root#x/y?a=b');
|
||||
};
|
||||
Backbone.history = _.extend(new Backbone.History, {
|
||||
location: location,
|
||||
@@ -904,7 +904,7 @@
|
||||
Backbone.history.stop();
|
||||
location.replace('/root?foo=bar');
|
||||
location.replace = function(url) {
|
||||
strictEqual(url, '/root/#?foo=bar');
|
||||
strictEqual(url, '/root#?foo=bar');
|
||||
};
|
||||
Backbone.history = _.extend(new Backbone.History, {
|
||||
location: location,
|
||||
|
||||
Reference in New Issue
Block a user