mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-22 20:51:10 +01:00
Set content-type to application/json
Summary: Elasticsearch really wants a raw json body and it fails to accept the request as of es version 5.3 Test Plan: Tested with elasticsearch 5.2 and 5.3. Before this change 5.2 worked but 5.3 failed with `HTTP/406 "Content-Type header [application/x-www-form-urlencoded] is not supported"` [1] After this change, both worked. [1] https://phabricator.wikimedia.org/P5158 Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17580
This commit is contained in:
parent
654f0f6043
commit
67a1c40476
1 changed files with 2 additions and 0 deletions
|
@ -551,6 +551,8 @@ class PhabricatorElasticFulltextStorageEngine
|
|||
$uri = $host->getURI($path);
|
||||
$data = phutil_json_encode($data);
|
||||
$future = new HTTPSFuture($uri, $data);
|
||||
$future->addHeader('Content-Type', 'application/json');
|
||||
|
||||
if ($method != 'GET') {
|
||||
$future->setMethod($method);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue