|
|
|
@ -59,8 +59,8 @@ async function checkCors(url, method) {
|
|
|
|
|
const origin = headers["access-control-allow-origin"];
|
|
|
|
|
if (origin !== "*" && origin !== window.location.origin) return false;
|
|
|
|
|
|
|
|
|
|
const methods = headers["access-control-allow-methods"]?.split(/,\s/g);
|
|
|
|
|
if (methods && !methods.includes(method)) return false;
|
|
|
|
|
const methods = headers["access-control-allow-methods"]?.toLowerCase().split(/,\s/g);
|
|
|
|
|
if (methods && !methods.includes(method.toLowerCase())) return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|