From: Jakub Vrana Date: Wed, 19 Feb 2025 11:31:44 +0000 (+0100) Subject: Elastic 5: Do not set Content-Type without content X-Git-Tag: v4.16.0~27 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=e5c05fe26c7ec5330f745ecbc1f850007e3e99f5;p=adminer.git Elastic 5: Do not set Content-Type without content --- diff --git a/plugins/drivers/elastic5.php b/plugins/drivers/elastic5.php index c277a0ad..ec5ec5f6 100644 --- a/plugins/drivers/elastic5.php +++ b/plugins/drivers/elastic5.php @@ -17,8 +17,8 @@ if (isset($_GET["elastic5"])) { function rootQuery($path, $content = array(), $method = 'GET') { $file = @file_get_contents("$this->_url/" . ltrim($path, '/'), false, stream_context_create(array('http' => array( 'method' => $method, - 'content' => $content === null ? $content : json_encode($content), - 'header' => 'Content-Type: application/json', + 'content' => $content !== null ? json_encode($content) : $content, + 'header' => $content !== null ? 'Content-Type: application/json' : array(), 'ignore_errors' => 1, // available since PHP 5.2.10 'follow_location' => 0, 'max_redirects' => 0,