From 2ec1446b2882ee046d1cefca427a7ad046a6d633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Mrozi=C5=84ski?= Date: Fri, 7 Apr 2017 18:43:30 +0200 Subject: [PATCH] Cast getSize() to string for Content-Length header --- src/Server.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Server.php b/src/Server.php index e081fb62..87ae5054 100644 --- a/src/Server.php +++ b/src/Server.php @@ -341,7 +341,7 @@ public function handleResponse(ConnectionInterface $connection, RequestInterface } if (!$response->getBody() instanceof HttpBodyStream) { - $response = $response->withHeader('Content-Length', $response->getBody()->getSize()); + $response = $response->withHeader('Content-Length', (string)$response->getBody()->getSize()); } elseif (!$response->hasHeader('Content-Length') && $request->getProtocolVersion() === '1.1') { // assign chunked transfer-encoding if no 'content-length' is given for HTTP/1.1 responses $response = $response->withHeader('Transfer-Encoding', 'chunked');