all repos — archive/homestead @ 7c376d43ed17ffb44933f3ac8c1c8b8590dd675e

My future indieweb platform

Send last-modified header
Alan Pearce alan@alanpearce.eu
Wed, 13 Sep 2023 06:36:39 +0200
commit

7c376d43ed17ffb44933f3ac8c1c8b8590dd675e

parent

a5e05c9241c8c6e7f0a8ce54fecdbb7df3c1ecec

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M src/index.tssrc/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 {