From 8a5f3174fe8920a76a09fa4c6b379114f2574c2a Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 29 Jan 2019 15:22:53 -0800 Subject: [PATCH] rgw: es: query sent to elasticsearch needs content-type Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_sync_module_es_rest.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_sync_module_es_rest.cc b/src/rgw/rgw_sync_module_es_rest.cc index 204adb43adc..8a8d895b326 100644 --- a/src/rgw/rgw_sync_module_es_rest.cc +++ b/src/rgw/rgw_sync_module_es_rest.cc @@ -245,7 +245,8 @@ void RGWMetadataSearchOp::execute() params.push_back(param_pair_t("from", marker_str.c_str())); } ldout(s->cct, 20) << "sending request to elasticsearch, payload=" << string(in.c_str(), in.length()) << dendl; - op_ret = conn->get_resource(resource, ¶ms, nullptr, out, &in); + map extra_headers = {{"Content-Type", "application/json"}}; + op_ret = conn->get_resource(resource, ¶ms, &extra_headers, out, &in); if (op_ret < 0) { ldout(s->cct, 0) << "ERROR: failed to fetch resource (r=" << resource << ", ret=" << op_ret << ")" << dendl; return; -- 2.47.3