diff --git a/CHANGELOG.md b/CHANGELOG.md index ce16c89ab0..01691a1538 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Updated `symfony/phpunit-bridge` to `6.0` by @franmomu [#2067](https://github.com/ruflin/Elastica/pull/2067) ### Deprecated ### Removed +* Removed `0` as valid request data using Analyze API by @franmomu [#2068](https://github.com/ruflin/Elastica/pull/2068) ### Fixed ### Security diff --git a/src/Transport/Guzzle.php b/src/Transport/Guzzle.php index 79a7b84543..436eb07cb5 100755 --- a/src/Transport/Guzzle.php +++ b/src/Transport/Guzzle.php @@ -118,7 +118,7 @@ protected function _createPsr7Request(Request $request, Connection $connection) ); $data = $request->getData(); - if (!empty($data) || '0' === $data) { + if (!empty($data)) { if (Request::GET === $req->getMethod()) { $req = $req->withMethod(Request::POST); } diff --git a/src/Transport/Http.php b/src/Transport/Http.php index b434cd4787..ab4d663faa 100644 --- a/src/Transport/Http.php +++ b/src/Transport/Http.php @@ -122,7 +122,7 @@ public function exec(Request $request, array $params): Response $headers[] = 'Content-Type: '.$request->getContentType(); - if (!empty($data) || '0' === $data) { + if (!empty($data)) { if ($this->hasParam('postWithRequestBody') && true == $this->getParam('postWithRequestBody')) { $httpMethod = Request::POST; }