From f8ec0fdf45c787a41061128683cc3ef40a788d77 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 7 Nov 2016 10:48:57 +0300 Subject: [PATCH] Update Message.php Fixed "stream_get_contents() expects parameter 2 to be long, string given" when in server request 'Content-Length' is an empty string. --- lib/Message.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Message.php b/lib/Message.php index f190071..e50a912 100644 --- a/lib/Message.php +++ b/lib/Message.php @@ -81,7 +81,7 @@ function getBodyAsString() : string { return ob_get_clean(); } $contentLength = $this->getHeader('Content-Length'); - if (null === $contentLength) { + if (null === $contentLength || empty($contentLength)) { return stream_get_contents($body); } else { return stream_get_contents($body, (int)$contentLength);