From 40a7aa5079ec6df5a9f965c7a1a28821cce14973 Mon Sep 17 00:00:00 2001 From: V Date: Sun, 9 Apr 2023 06:58:29 +0200 Subject: [PATCH] UserScript: Fix cors check --- browser/GMPolyfill.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser/GMPolyfill.js b/browser/GMPolyfill.js index 6f05ca0bf..beee9156a 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; }