diff --git a/flight/Engine.php b/flight/Engine.php index c325394..b2900c4 100644 --- a/flight/Engine.php +++ b/flight/Engine.php @@ -857,8 +857,8 @@ class Engine ?string $charset = 'utf-8', int $option = 0 ): void { - // add some default flags - $option |= JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR; + // add some default flags + $option |= JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR; $json = $encode ? json_encode($data, $option) : $data; $this->response() diff --git a/flight/net/Response.php b/flight/net/Response.php index 264174e..9e4d58b 100644 --- a/flight/net/Response.php +++ b/flight/net/Response.php @@ -432,11 +432,6 @@ class Response } if ($this->headersSent() === false) { - // If you haven't set a Cache-Control header, we'll assume you don't want caching - if ($this->getHeader('Cache-Control') === null) { - $this->cache(false); - } - $this->sendHeaders(); } diff --git a/tests/ResponseTest.php b/tests/ResponseTest.php index fade322..3f21780 100644 --- a/tests/ResponseTest.php +++ b/tests/ResponseTest.php @@ -268,9 +268,6 @@ class ResponseTest extends TestCase 'HTTP/1.1 200 OK', 'Content-Type: text/html', 'X-Test: test', - 'Expires: Mon, 26 Jul 1997 05:00:00 GMT', - 'Cache-Control: no-store, no-cache, must-revalidate, max-age=0', - 'Pragma: no-cache', 'Content-Length: 9' ], $sent_headers); } diff --git a/tests/commands/RouteCommandTest.php b/tests/commands/RouteCommandTest.php index aa3fff3..226d9a3 100644 --- a/tests/commands/RouteCommandTest.php +++ b/tests/commands/RouteCommandTest.php @@ -81,10 +81,10 @@ PHP; protected function removeColors(string $str): string { - // replace \n with \r\n if windows - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - $str = str_replace("\r\n", "\n", $str); - } + // replace \n with \r\n if windows + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + $str = str_replace("\r\n", "\n", $str); + } return preg_replace('/\e\[[\d;]*m/', '', $str); }