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
|
onLoggedInChanged
|
||||||
}) {
|
}) {
|
||||||
return new Promise((accept, reject) => {
|
return new Promise((accept, reject) => {
|
||||||
acceptedOrigins = acceptedOrigins ?? ["https://galaxy.click/"];
|
acceptedOrigins = acceptedOrigins.map(url =>
|
||||||
if (acceptedOrigins.includes(document.referrer)) {
|
url.replace(/\/?$/, '/')) ?? ["https://galaxy.click/"];
|
||||||
|
if (acceptedOrigins.includes(document.referrer.replace(/\/?$/, '/'))) {
|
||||||
// Callbacks to resolve promises
|
// Callbacks to resolve promises
|
||||||
/** @type function(SaveListResponse["list"]):void */
|
/** @type function(SaveListResponse["list"]):void */
|
||||||
let saveListAccept,
|
let saveListAccept,
|
||||||
|
@ -180,7 +181,7 @@ export function initGalaxy({
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener("message", e => {
|
window.addEventListener("message", e => {
|
||||||
if (e.origin === galaxy.origin) {
|
if (e.origin.replace(/\/?$/, '/') === galaxy.origin.replace(/\/?$/, '/')) {
|
||||||
console.log("Received message from Galaxy", e.data);
|
console.log("Received message from Galaxy", e.data);
|
||||||
/** @type GalaxyResponse */
|
/** @type GalaxyResponse */
|
||||||
const data = e.data;
|
const data = e.data;
|
||||||
|
|
Loading…
Add table
Reference in a new issue