Skip to content

Commit 7f23172

Browse files
committed
feat: remove Content-Length header from responses to improve handling of dynamic content
1 parent 849812f commit 7f23172

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/frameworks/laravel/http_request.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ function ddless_response_status_text(int $statusCode): ?string
655655
echo $capturedBodyContent;
656656
}
657657
} else {
658+
$response->headers->remove('Content-Length');
658659
$response->send();
659660
if (is_string($responseBodyContent)) {
660661
$capturedBodyContent = $responseBodyContent;

src/frameworks/symfony/http_request.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ function ddless_response_status_text(int $statusCode): ?string
580580
echo $capturedBodyContent;
581581
}
582582
} else {
583+
$response->headers->remove('Content-Length');
583584
$response->send();
584585
if (is_string($responseBodyContent)) {
585586
$capturedBodyContent = $responseBodyContent;

src/frameworks/tempest/http_request.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ function ddless_response_status_text(int $statusCode): ?string
675675
if (is_object($response) && method_exists($response, 'send')) {
676676
ob_start();
677677
$response->send();
678+
header_remove('Content-Length');
678679
$bodyOutput = ob_get_clean();
679680
$capturedBodyContent = is_string($bodyOutput) ? $bodyOutput : $responseBodyContent;
680681
} else {

0 commit comments

Comments
 (0)