mirror of
https://github.com/theoleuthardt/werkzeugkiste.git
synced 2026-06-13 09:37:53 +00:00
fix: security issue fixed by not assigning download blob url to button, instead create a html element and auto click it for download
This commit is contained in:
parent
3bcd052235
commit
b4d7bccc57
3 changed files with 31 additions and 23 deletions
|
|
@ -6,7 +6,12 @@ import { colorConvert } from "./src/routes/colorconvert.route";
|
|||
|
||||
const app = Fastify({ logger: true });
|
||||
|
||||
app.register(cors, { origin: "*", exposedHeaders: 'Content-Disposition' });
|
||||
app.register(cors, {
|
||||
origin: "*",
|
||||
exposedHeaders: "Content-Disposition",
|
||||
methods: "POST",
|
||||
allowedHeaders: "Content-Type",
|
||||
});
|
||||
app.register(multipart);
|
||||
app.register(libreConvert);
|
||||
app.register(colorConvert);
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ export async function libreConvert(app: FastifyInstance) {
|
|||
"Content-Disposition",
|
||||
`attachment; filename="converted${outputFileExt}"`,
|
||||
)
|
||||
.status(200)
|
||||
.send(convertedBuffer);
|
||||
} catch (error) {
|
||||
console.error("Convert error:", error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue