From 7bc6bc24a220a5b5425b9b3f2b613c901f62f187 Mon Sep 17 00:00:00 2001 From: Pierre Date: Wed, 10 Jun 2015 10:09:12 +0200 Subject: [PATCH] Fix curl headers for solr > 5 --- library/Solarium/Core/Client/Adapter/Curl.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/Solarium/Core/Client/Adapter/Curl.php b/library/Solarium/Core/Client/Adapter/Curl.php index a155cc4c8..5035d23e1 100644 --- a/library/Solarium/Core/Client/Adapter/Curl.php +++ b/library/Solarium/Core/Client/Adapter/Curl.php @@ -156,7 +156,11 @@ public function createHandle($request, $endpoint) } if (!isset($options['headers']['Content-Type'])) { - $options['headers']['Content-Type'] = 'text/xml; charset=utf-8'; + if($method == Request::METHOD_GET){ + $options['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'; + } else { + $options['headers']['Content-Type'] = 'application/xml; charset=utf-8'; + } } // Try endpoint authentication first, fallback to request for backwards compatibility