diff --git a/flight/Engine.php b/flight/Engine.php index a1378a6..4dd595f 100644 --- a/flight/Engine.php +++ b/flight/Engine.php @@ -610,6 +610,7 @@ class Engine try { $this->response() + ->cache(0) ->clearBody() ->status(500) ->write($msg) @@ -736,6 +737,10 @@ class Engine */ public function _halt(int $code = 200, string $message = '', bool $actuallyExit = true): void { + if ($this->response()->getHeader('Cache-Control') === null) { + $this->response()->cache(0); + } + $this->response() ->clearBody() ->status($code) diff --git a/flight/net/Response.php b/flight/net/Response.php index 362fe5d..73be770 100644 --- a/flight/net/Response.php +++ b/flight/net/Response.php @@ -286,7 +286,7 @@ class Response */ public function cache($expires): self { - if ($expires === false) { + if ($expires === false || $expires === 0) { $this->headers['Expires'] = 'Mon, 26 Jul 1997 05:00:00 GMT'; $this->headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, max-age=0'; $this->headers['Pragma'] = 'no-cache';