Skip to content

Commit

Permalink
Merge pull request #164 from maciejmrozinski/fix_get_size_int
Browse files Browse the repository at this point in the history
Cast getSize() to string for Content-Length header
  • Loading branch information
WyriHaximus authored Apr 7, 2017
2 parents d9eba1b + 2ec1446 commit 16cd72f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 16cd72f

Please sign in to comment.