summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2023-09-13 11:12:50 +0200
committerAlan Pearce2023-09-13 11:12:50 +0200
commit2c41c45c48761ee8d7bb503c6966edb00b82457d (patch)
tree838affd1851e12e0785d62f3da13087dd97ddcac
parent93197c349e19f1e5b1cb5244827eab64aa4ebba4 (diff)
downloadwebsite-2c41c45c48761ee8d7bb503c6966edb00b82457d.tar.lz
website-2c41c45c48761ee8d7bb503c6966edb00b82457d.tar.zst
website-2c41c45c48761ee8d7bb503c6966edb00b82457d.zip
Fix incorrect file existence check
-rw-r--r--src/index.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/index.ts b/src/index.ts
index 69c9b1a..7188e6c 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -74,7 +74,7 @@ async function serveFile(
   statusCode: number = 200,
   extraHeaders: Record<string, string> = {},
 ): Promise<Response> {
-  if (file && file.handle.exists()) {
+  if (file && (await file.handle.exists())) {
     return new Response(file.handle, {
       headers: {
         "last-modified": file.mtime.toUTCString(),