about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorAlan Pearce2023-09-13 06:36:39 +0200
committerAlan Pearce2023-09-13 06:36:39 +0200
commit7c376d43ed17ffb44933f3ac8c1c8b8590dd675e (patch)
tree765f956e1a58b5a64063ae3a69deffd9c889c266 /src
parenta5e05c9241c8c6e7f0a8ce54fecdbb7df3c1ecec (diff)
downloadwebsite-7c376d43ed17ffb44933f3ac8c1c8b8590dd675e.tar.lz
website-7c376d43ed17ffb44933f3ac8c1c8b8590dd675e.tar.zst
website-7c376d43ed17ffb44933f3ac8c1c8b8590dd675e.zip
Send last-modified header
Diffstat (limited to 'src')
-rw-r--r--src/index.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/index.ts b/src/index.ts
index f423b01..8b8ab0b 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -66,7 +66,10 @@ async function serveFile(
 ): 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 {