Skip to content

Commit

Permalink
Capitalize 'Content-Type' for maximum compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Aug 22, 2017
1 parent 95d2f89 commit b8ad96c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Elasticsearch/ClientBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,16 +474,16 @@ public function build()
$this->connectionParams = [];
}

// Make sure we are setting Content-type and Accept (unless the user has explicitly
// Make sure we are setting Content-Type and Accept (unless the user has explicitly
// overridden it
if (isset($this->connectionParams['client']['headers']) === false) {
$this->connectionParams['client']['headers'] = [
'Content-type' => ['application/json'],
'Content-Type' => ['application/json'],
'Accept' => ['application/json']
];
} else {
if (isset($this->connectionParams['client']['headers']['Content-type']) === false) {
$this->connectionParams['client']['headers']['Content-type'] = ['application/json'];
if (isset($this->connectionParams['client']['headers']['Content-Type']) === false) {
$this->connectionParams['client']['headers']['Content-Type'] = ['application/json'];
}
if (isset($this->connectionParams['client']['headers']['Accept']) === false) {
$this->connectionParams['client']['headers']['Accept'] = ['application/json'];
Expand Down

0 comments on commit b8ad96c

Please sign in to comment.