Skip to content

Commit 16cd72f

Browse files
authored
Merge pull request #164 from maciejmrozinski/fix_get_size_int
Cast getSize() to string for Content-Length header
2 parents d9eba1b + 2ec1446 commit 16cd72f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public function handleResponse(ConnectionInterface $connection, RequestInterface
341341
}
342342

343343
if (!$response->getBody() instanceof HttpBodyStream) {
344-
$response = $response->withHeader('Content-Length', $response->getBody()->getSize());
344+
$response = $response->withHeader('Content-Length', (string)$response->getBody()->getSize());
345345
} elseif (!$response->hasHeader('Content-Length') && $request->getProtocolVersion() === '1.1') {
346346
// assign chunked transfer-encoding if no 'content-length' is given for HTTP/1.1 responses
347347
$response = $response->withHeader('Transfer-Encoding', 'chunked');

0 commit comments

Comments
 (0)