From f18f6f0d600363aa28d655150faed780769a6813 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Tue, 3 Dec 2024 22:55:56 +0800 Subject: [PATCH] refactor(fetch-jsonp): change callback name to prevent triggering WAF --- src/fetch-jsonp/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetch-jsonp/index.ts b/src/fetch-jsonp/index.ts index 6a9d6a2..c35f9e1 100644 --- a/src/fetch-jsonp/index.ts +++ b/src/fetch-jsonp/index.ts @@ -22,7 +22,7 @@ export function fetchJsonp(getUrl: (callbackName: string) => string) { }); } - const callbackName = `$${Date.now()}_${Math.random().toString().slice(2)}$`; + const callbackName = `__${Date.now()}_${Math.random().toString().slice(2)}__`; const fullCallbackName = `window.${INTERNAL}.${callbackName}`; // eslint-disable-next-line prefer-object-has-own -- conflict check if (Object.prototype.hasOwnProperty.call(window[INTERNAL], callbackName)) {