From 2c41c45c48761ee8d7bb503c6966edb00b82457d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 13 Sep 2023 11:12:50 +0200 Subject: Fix incorrect file existence check --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = {}, ): Promise { - if (file && file.handle.exists()) { + if (file && (await file.handle.exists())) { return new Response(file.handle, { headers: { "last-modified": file.mtime.toUTCString(), -- cgit 1.4.1