mirror of
https://github.com/penpot/penpot-plugins.git
synced 2025-01-23 07:08:47 -05:00
fix(runtime): prevent use api credentials
This commit is contained in:
parent
0eadac1e75
commit
1699e6dedb
1 changed files with 8 additions and 1 deletions
|
@ -35,7 +35,14 @@ export const ɵloadPlugin = async function (manifest: Manifest) {
|
||||||
|
|
||||||
const c = new Compartment({
|
const c = new Compartment({
|
||||||
penpot: harden(pluginApi),
|
penpot: harden(pluginApi),
|
||||||
fetch: window.fetch.bind(window),
|
fetch: harden((...args: Parameters<typeof fetch>) => {
|
||||||
|
const requestArgs: RequestInit = {
|
||||||
|
...args[1],
|
||||||
|
credentials: 'omit',
|
||||||
|
};
|
||||||
|
|
||||||
|
return fetch(args[0], requestArgs);
|
||||||
|
}),
|
||||||
console: harden(window.console),
|
console: harden(window.console),
|
||||||
Math: harden(Math),
|
Math: harden(Math),
|
||||||
setTimeout: harden(
|
setTimeout: harden(
|
||||||
|
|
Loading…
Add table
Reference in a new issue