We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1eae2f0 commit 1419278Copy full SHA for 1419278
packages/web/src/app/api/[chainId]/files/[filename]/download/route.ts
@@ -13,11 +13,12 @@ export async function GET(
13
14
if (!file) return new Response(null, { status: 404 });
15
16
- return new Response(file.contents, {
+ return new Response(null, {
17
+ status: 302,
18
headers: {
- "Content-Disposition": `attachment; filename=${encodeURIComponent(file.filename)}`,
19
- ...(file.type ? { "Content-Type": file.type } : null),
20
- ...(file.encoding ? { "Content-Encoding": file.encoding } : null),
+ Location: `data:${file.type}${
+ file.encoding === "base64" ? ";base64" : ""
21
+ },${file.contents}`,
22
},
23
});
24
}
0 commit comments