This commit is contained in:
xl
2023-11-22 10:09:27 +08:00
parent 1f592689ef
commit 09c3890ccd
+3
View File
@@ -126,6 +126,9 @@ class OnRequest implements OnRequestInterface
} catch (Throwable $throwable) { } catch (Throwable $throwable) {
$PsrResponse = $this->exception->emit($throwable, $this->constrictResponse); $PsrResponse = $this->exception->emit($throwable, $this->constrictResponse);
} finally { } finally {
if ($request->getMethod() === 'HEAD') {
$PsrResponse->getBody()->write('');
}
$this->responseEmitter->response($PsrResponse, $response, $PsrRequest); $this->responseEmitter->response($PsrResponse, $response, $PsrRequest);
} }
} }