aboutsummaryrefslogtreecommitdiff
path: root/browser/GMPolyfill.js
diff options
context:
space:
mode:
Diffstat (limited to 'browser/GMPolyfill.js')
-rw-r--r--browser/GMPolyfill.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/browser/GMPolyfill.js b/browser/GMPolyfill.js
index beee915..1f74a7c 100644
--- a/browser/GMPolyfill.js
+++ b/browser/GMPolyfill.js
@@ -59,7 +59,9 @@ 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"]?.toLowerCase().split(/,\s/g);
+ const methods = headers["access-control-allow-methods"]?.toLowerCase()
+ .split(",")
+ .map(s => s.trim());
if (methods && !methods.includes(method.toLowerCase())) return false;
return true;