|
|
|
@ -67,11 +67,7 @@ class Route
|
|
|
|
|
*/
|
|
|
|
|
public array $middleware = [];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Whether the response for this route should be streamed.
|
|
|
|
|
*
|
|
|
|
|
* @var boolean
|
|
|
|
|
*/
|
|
|
|
|
/** Whether the response for this route should be streamed. */
|
|
|
|
|
public bool $is_streamed = false;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -227,8 +223,6 @@ class Route
|
|
|
|
|
* Sets the route middleware
|
|
|
|
|
*
|
|
|
|
|
* @param array<int, callable>|callable $middleware
|
|
|
|
|
*
|
|
|
|
|
* @return self
|
|
|
|
|
*/
|
|
|
|
|
public function addMiddleware($middleware): self
|
|
|
|
|
{
|
|
|
|
@ -245,12 +239,13 @@ class Route
|
|
|
|
|
*
|
|
|
|
|
* @param array<string, mixed> $headers a key value of headers to set before the stream starts.
|
|
|
|
|
*
|
|
|
|
|
* @return self
|
|
|
|
|
* @return $this
|
|
|
|
|
*/
|
|
|
|
|
public function streamWithHeaders(array $headers): self
|
|
|
|
|
{
|
|
|
|
|
$this->is_streamed = true;
|
|
|
|
|
$this->streamed_headers = $headers;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|