FIX: removes extra slashes from URL (#11433)
This is similar to a fix used in ember core: https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/routing/lib/location/history_location.ts#L140 It will prevent a URL with a double slash to hang and end up in a 404.
This commit is contained in:
parent
7a079b9e3b
commit
b824af02d4
|
@ -66,6 +66,7 @@ const DiscourseLocation = EmberObject.extend({
|
|||
let url = withoutPrefix(this.location.pathname);
|
||||
const search = this.location.search || "";
|
||||
url += search;
|
||||
url = url.replace(/\/\//g, "/"); // remove extra slashes
|
||||
return url;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue