From d08e069092480e413512b7bbc9e18a69b8f1b852 Mon Sep 17 00:00:00 2001 From: masx200 <34191203+masx200@users.noreply.github.com> Date: Thu, 24 Jun 2021 11:42:41 +0800 Subject: [PATCH] Update application.js --- lib/application.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/application.js b/lib/application.js index 6849d73fd..1c61103e4 100644 --- a/lib/application.js +++ b/lib/application.js @@ -229,7 +229,9 @@ module.exports = class Application extends Emitter { function respond(ctx) { // allow bypassing koa if (false === ctx.respond) return; - +if (ctx.method === "HEAD") { + ctx.res.end(); + } if (!ctx.writable) return; const res = ctx.res;