mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
Don't add trailing slash to end of url with parameters
no issue - updates the `TrailingHistory` locationType so that trailing slashes aren't added to the end of URLs with parameters but instead matches how the server-side redirects to trailing-slash URLs - before: `/subscribers?order=created_at/` - after: `/subscribers/?order=created_at`
This commit is contained in:
parent
50d1737a25
commit
98f92c1444
@ -4,7 +4,13 @@ const {HistoryLocation} = Ember;
|
||||
|
||||
let trailingHistory = HistoryLocation.extend({
|
||||
formatURL() {
|
||||
return this._super(...arguments).replace(/\/?$/, '/');
|
||||
let url = this._super(...arguments);
|
||||
|
||||
if (url.indexOf('?') > 0) {
|
||||
return url.replace(/([^\/])\?/, '$1/?');
|
||||
} else {
|
||||
return url.replace(/\/?$/, '/');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user