diff --git a/src/Http/Request.php b/src/Http/Request.php index 2aaff910..979e3193 100644 --- a/src/Http/Request.php +++ b/src/Http/Request.php @@ -77,7 +77,7 @@ public function __construct( $this->files = (array) $files; $this->cookies = (array) $cookies; $this->headers = array_change_key_case((array) $headers, CASE_LOWER); - $this->method = $method ?: 'GET'; + $this->method = $method ?: (PHP_SAPI === 'cli' ? 'CLI' : 'GET'); $this->remoteAddress = $remoteAddress; $this->remoteHost = $remoteHost; $this->rawBodyCallback = $rawBodyCallback; diff --git a/src/Http/Response.php b/src/Http/Response.php index 1c71bacd..e2ca6a65 100644 --- a/src/Http/Response.php +++ b/src/Http/Response.php @@ -311,7 +311,7 @@ private function checkHeaders(): void ob_get_length() && !array_filter(ob_get_status(true), function (array $i): bool { return !$i['chunk_size']; }) ) { - trigger_error('Possible problem: you are sending a HTTP header while already having some data in output buffer. Try Tracy\OutputDebugger or start session earlier.'); + trigger_error('Possible problem: you are sending a HTTP header while already having some data in output buffer. Try Tracy\OutputDebugger or send cookies/start session earlier.'); } } }