diff --git a/HttpServer/Controller.php b/HttpServer/Controller.php index dae71db0..6492d66d 100644 --- a/HttpServer/Controller.php +++ b/HttpServer/Controller.php @@ -112,7 +112,7 @@ class Controller extends Application */ public function getHeaders(): ?HttpHeaders { - if (!$this->headers) { + if (!$this->headers && $this->getRequest()) { $this->headers = $this->getRequest()->headers; } return $this->headers;