Skip to content

Commit

Permalink
refactor(fetch-jsonp): change callback name to prevent triggering WAF
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Dec 3, 2024
1 parent a9202dd commit f18f6f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fetch-jsonp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function fetchJsonp<T>(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)) {
Expand Down

0 comments on commit f18f6f0

Please sign in to comment.