Skip to content

Commit 90d006c

Browse files
committed
Merge pull request #341 from basdenooijer/master
Fix curl headers for solr > 5
2 parents a9c1c5f + 2157a3d commit 90d006c

File tree

1 file changed

+5
-1
lines changed
  • library/Solarium/Core/Client/Adapter

1 file changed

+5
-1
lines changed

library/Solarium/Core/Client/Adapter/Curl.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,11 @@ public function createHandle($request, $endpoint)
156156
}
157157

158158
if (!isset($options['headers']['Content-Type'])) {
159-
$options['headers']['Content-Type'] = 'text/xml; charset=utf-8';
159+
if($method == Request::METHOD_GET){
160+
$options['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8';
161+
} else {
162+
$options['headers']['Content-Type'] = 'application/xml; charset=utf-8';
163+
}
160164
}
161165

162166
// Try endpoint authentication first, fallback to request for backwards compatibility

0 commit comments

Comments
 (0)