Skip to content

Commit

Permalink
Fix curl headers for solr > 5
Browse files Browse the repository at this point in the history
  • Loading branch information
mfpierre committed Jun 10, 2015
1 parent 45ed465 commit 7bc6bc2
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 7bc6bc2

Please sign in to comment.