Skip to content

Commit cae87fb

Browse files
committed
fix: remove cors-proxy api
AdminForth/1731/security-audit
1 parent 1064420 commit cae87fb

2 files changed

Lines changed: 0 additions & 17 deletions

File tree

custom/imageGenerator.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,6 @@ async function confirmImage() {
302302
}
303303
const byteArray = new Uint8Array(byteNumbers);
304304
imgBlob = new Blob([byteArray], { type: mimeType });
305-
} else {
306-
imgBlob = await fetch(
307-
`${import.meta.env.VITE_ADMINFORTH_PUBLIC_PATH || ''}/adminapi/v1/plugin/${props.meta.pluginInstanceId}/cors-proxy?url=${encodeURIComponent(img)}`
308-
).then(res => { return res.blob() });
309305
}
310306
311307
emit('uploadImage', imgBlob);

index.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -494,19 +494,6 @@ export default class UploadPlugin extends AdminForthPlugin {
494494
return { ok: true, job };
495495
}
496496
});
497-
498-
server.endpoint({
499-
method: 'GET',
500-
path: `/plugin/${this.pluginInstanceId}/cors-proxy`,
501-
handler: async ({ query, response }) => {
502-
const { url } = query;
503-
const resp = await fetch(url);
504-
response.setHeader('Content-Type', resp.headers.get('Content-Type'));
505-
//@ts-ignore
506-
Readable.fromWeb( resp.body ).pipe( response.blobStream() );
507-
return null
508-
}
509-
});
510497

511498
server.endpoint({
512499
method: 'POST',

0 commit comments

Comments
 (0)