fix: 🐛 silently drop trailing slashes from origin input

This commit is contained in:
Randall Morey committed 2021-04-08 13:45:19 -04:00
1 parent 80cffeb48b
commit 0d8508cd4e
4 files changed
+21 -23

No files matched your search

+4
View File
@@ -63,6 +63,10 @@ export default class OriginService extends Service {
typeof origin === 'string'
);
try {
// Silently drop trailing slashes if present.
// This is important since API paths that will be appended to the origin
// will include preceeding slashes already.
origin = origin.replace(/\/*$/, '');
this.adapter.host = origin;
this.rendererOrigin = origin;
if (origin !== (await this.mainOrigin)) {