Skip to content

Commit 2fa73f0

Browse files
committed
fix: remove manual Content-Length header for static files
Swoole automatically handles Content-Length when compression is involved. Manual setting causes warnings when Accept-Encoding header is present.
1 parent 336df06 commit 2fa73f0

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/Server/HttpServer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ private function tryServeStaticFile(Request $request, Response $response): bool
360360
// Set response headers
361361
$response->status(200);
362362
$response->header('Content-Type', $this->staticFileExtensions[$extension]);
363-
$response->header('Content-Length', (string) strlen($content));
364363
$response->header('X-Content-Type-Options', 'nosniff');
365364

366365
// Add cache headers for static files

0 commit comments

Comments
 (0)