Skip to content

Commit

Permalink
Tune proxy 403
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Jan 4, 2022
1 parent b1e3ee1 commit 4a25045
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/proxy/proxy-media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function proxyMedia(ctx: Router.RouterContext) {
} else if (['image/svg+xml'].includes(mime)) {
image = await convertToPng(path, 2048, 2048);
} else if (!mime.startsWith('image/') || !FILE_TYPE_BROWSERSAFE.includes(mime)) {
ctx.throw(403);
throw new StatusError('403 Rejected type', 403, 'Rejected type');
} else {
image = {
data: fs.readFileSync(path),
Expand Down

0 comments on commit 4a25045

Please sign in to comment.