This commit is contained in:
Viet An
2026-05-07 10:53:09 +07:00
parent 6e10dffd22
commit 56cfcd09bf
15 changed files with 439 additions and 1951 deletions

12
server/api/hello.js Normal file
View File

@@ -0,0 +1,12 @@
export default defineEventHandler(async (event) => {
const query = getQuery(event);
const response = await $fetch.raw(query.url, { responseType: "arrayBuffer" });
// Copy the content-type from the upstream response
const contentType = response.headers.get("content-type") || "application/octet-stream";
setHeader(event, "Content-Type", contentType);
setHeader(event, "Content-Disposition", `attachment; filename="download"`);
return response._data;
});