aboutsummaryrefslogtreecommitdiff
path: root/browser
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-04-09 06:58:29 +0200
committerGitHub <noreply@github.com>2023-04-09 06:58:29 +0200
commit40a7aa5079ec6df5a9f965c7a1a28821cce14973 (patch)
tree0927873c668ed9512e81fba4ea429a1f03cda824 /browser
parentc4a3d25d37697282dce756d9addc36c23ba1f2ce (diff)
downloadVencord-40a7aa5079ec6df5a9f965c7a1a28821cce14973.tar.gz
Vencord-40a7aa5079ec6df5a9f965c7a1a28821cce14973.tar.bz2
Vencord-40a7aa5079ec6df5a9f965c7a1a28821cce14973.zip
UserScript: Fix cors check
Diffstat (limited to 'browser')
-rw-r--r--browser/GMPolyfill.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/browser/GMPolyfill.js b/browser/GMPolyfill.js
index 6f05ca0..beee915 100644
--- a/browser/GMPolyfill.js
+++ b/browser/GMPolyfill.js
@@ -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;
}