Send last-modified header
Alan Pearce alan@alanpearce.eu
Wed, 13 Sep 2023 06:36:39 +0200
1 files changed, 4 insertions(+), 1 deletions(-)
jump to
M src/index.ts → src/index.ts
@@ -66,7 +66,10 @@ statusCode: number = 200, ): Promise<Response> { if (file && (await fsp.exists(file.filename))) { return new Response(Bun.file(file.filename), { - headers: file.headers || defaultHeaders, + headers: { + "last-modified": file.mtime, + ...(file.headers || defaultHeaders), + }, status: statusCode, }); } else {