Skip to content

Commit

Permalink
Update Http.php
Browse files Browse the repository at this point in the history
  • Loading branch information
localzet committed Sep 10, 2024
1 parent 51c730b commit 27350b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Server/Protocols/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public static function encode(mixed $response, TcpConnection $connection): strin

$response = is_object($response) ? $response : new Response(200, [], (string)$response);

if ($connection->headers) {
if ($connection->headers && method_exists($response, 'withHeaders')) {
// Добавляем заголовки соединения в ответ.
$response->withHeaders($connection->headers);
// Очищаем заголовки после использования.
Expand Down

0 comments on commit 27350b5

Please sign in to comment.