Make trailing slashes consistent
This commit is contained in:
parent
886c3bbb3a
commit
dae532627c
1 changed files with 4 additions and 3 deletions
|
@ -124,8 +124,9 @@ export function initGalaxy({
|
|||
onLoggedInChanged
|
||||
}) {
|
||||
return new Promise((accept, reject) => {
|
||||
acceptedOrigins = acceptedOrigins ?? ["https://galaxy.click/"];
|
||||
if (acceptedOrigins.includes(document.referrer)) {
|
||||
acceptedOrigins = acceptedOrigins.map(url =>
|
||||
url.replace(/\/?$/, '/')) ?? ["https://galaxy.click/"];
|
||||
if (acceptedOrigins.includes(document.referrer.replace(/\/?$/, '/'))) {
|
||||
// Callbacks to resolve promises
|
||||
/** @type function(SaveListResponse["list"]):void */
|
||||
let saveListAccept,
|
||||
|
@ -180,7 +181,7 @@ export function initGalaxy({
|
|||
};
|
||||
|
||||
window.addEventListener("message", e => {
|
||||
if (e.origin === galaxy.origin) {
|
||||
if (e.origin.replace(/\/?$/, '/') === galaxy.origin.replace(/\/?$/, '/')) {
|
||||
console.log("Received message from Galaxy", e.data);
|
||||
/** @type GalaxyResponse */
|
||||
const data = e.data;
|
||||
|
|
Loading…
Add table
Reference in a new issue