From d40d1e396f0472905d330afd3aa3709b29128543 Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Sun, 31 Jul 2022 14:17:06 +0700 Subject: [PATCH] fix: ServeStatic with zero bytes files --- controllers/handlers/ServeStatic.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/controllers/handlers/ServeStatic.js b/controllers/handlers/ServeStatic.js index a134e1d..a7a2819 100644 --- a/controllers/handlers/ServeStatic.js +++ b/controllers/handlers/ServeStatic.js @@ -255,6 +255,10 @@ class ServeStatic { return res.end() } + if (len === 0) { + res.end() + } + return this.#stream(req, res, fullPath, opts, len) }