From 09c3890ccd92d8852583a0d548664da5cdbe094d Mon Sep 17 00:00:00 2001 From: xl Date: Wed, 22 Nov 2023 10:09:27 +0800 Subject: [PATCH] eee --- Handler/OnRequest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Handler/OnRequest.php b/Handler/OnRequest.php index 5f77083..598219b 100644 --- a/Handler/OnRequest.php +++ b/Handler/OnRequest.php @@ -126,6 +126,9 @@ class OnRequest implements OnRequestInterface } catch (Throwable $throwable) { $PsrResponse = $this->exception->emit($throwable, $this->constrictResponse); } finally { + if ($request->getMethod() === 'HEAD') { + $PsrResponse->getBody()->write(''); + } $this->responseEmitter->response($PsrResponse, $response, $PsrRequest); } }