From 39908281a14897ba273e2ee5bd52da87e5b6f6f5 Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 6 Feb 2023 15:38:33 +0000 Subject: [PATCH] reply.send --- built/index.js | 2 +- package.json | 4 ++-- src/index.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/built/index.js b/built/index.js index 54744f9..5b75ad2 100644 --- a/built/index.js +++ b/built/index.js @@ -166,7 +166,7 @@ async function proxyHandler(request, reply) { } reply.header('Content-Type', image.type); reply.header('Cache-Control', 'max-age=31536000, immutable'); - return image.data; + return reply.send(image.data); } catch (e) { if ('cleanup' in file) diff --git a/package.json b/package.json index 4bf06f5..60d5c8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey-media-proxy", - "version": "0.0.2", + "version": "0.0.3", "description": "The Media Proxy for Misskey", "main": "built/index.js", "packageManager": "pnpm@7.26.0", @@ -12,7 +12,7 @@ ], "scripts": { "build": "tsc -p tsconfig.json", - "watch": "swc src -d built -D -w & fastify start -w -l info -P ./built/index.js", + "dev": "swc src -d built -D -w & fastify start -w -l info -P ./built/index.js", "start": "fastify start ./server.js" }, "repository": { diff --git a/src/index.ts b/src/index.ts index 96d8c49..218fe7d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -207,7 +207,7 @@ async function proxyHandler(request: FastifyRequest<{ Params: { url: string; }; reply.header('Content-Type', image.type); reply.header('Cache-Control', 'max-age=31536000, immutable'); - return image.data; + return reply.send(image.data); } catch (e) { if ('cleanup' in file) file.cleanup(); throw e;