Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.

Commit 8d45b37

Browse files
committed
removes trailing slash
1 parent e2b8d14 commit 8d45b37

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/opt-in-out-banner/banner.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export class BannerComponent extends GraphExplorerComponent {
1818
const path = location.href;
1919
const urlObject: URL = new URL(path);
2020
const { protocol, hostname, pathname, port } = urlObject;
21-
const url = `${protocol}//${hostname}${(port) ? ':' + port : ''}${pathname}`;
21+
let url = `${protocol}//${hostname}${(port) ? ':' + port : ''}${pathname}`;
22+
url = url.replace(/\/$/, '');
2223
window.location.href = url.includes('localhost') ? 'http://localhost:3000' : `${url}/preview`;
2324
}
2425

0 commit comments

Comments
 (0)