Skip to content

Commit

Permalink
Merge pull request #334 from mfpierre/fix-curl
Browse files Browse the repository at this point in the history
Fix curl headers for solr > 5
  • Loading branch information
basdenooijer committed Jun 11, 2015
2 parents 45ed465 + 7bc6bc2 commit 52a87a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion library/Solarium/Core/Client/Adapter/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52a87a8

Please sign in to comment.