Skip to content

Commit 80c1f5b

Browse files
author
Lukas Wegmann
authored
Applying the changes introduced in #87504 to the ESQL code base (#153)
1 parent f76d72c commit 80c1f5b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/RestEsqlQueryAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import org.elasticsearch.action.ActionListener;
1313
import org.elasticsearch.client.internal.node.NodeClient;
1414
import org.elasticsearch.rest.BaseRestHandler;
15-
import org.elasticsearch.rest.BytesRestResponse;
1615
import org.elasticsearch.rest.RestRequest;
16+
import org.elasticsearch.rest.RestResponse;
1717
import org.elasticsearch.rest.RestStatus;
1818
import org.elasticsearch.xcontent.XContentBuilder;
1919
import org.elasticsearch.xcontent.XContentParser;
@@ -50,7 +50,7 @@ public void onResponse(EsqlQueryResponse esqlQueryResponse) {
5050
try {
5151
XContentBuilder builder = channel.newBuilder(request.getXContentType(), XContentType.JSON, true);
5252
esqlQueryResponse.toXContent(builder, request);
53-
channel.sendResponse(new BytesRestResponse(RestStatus.OK, builder));
53+
channel.sendResponse(new RestResponse(RestStatus.OK, builder));
5454
} catch (Exception e) {
5555
onFailure(e);
5656
}
@@ -59,7 +59,7 @@ public void onResponse(EsqlQueryResponse esqlQueryResponse) {
5959
@Override
6060
public void onFailure(Exception e) {
6161
try {
62-
channel.sendResponse(new BytesRestResponse(channel, e));
62+
channel.sendResponse(new RestResponse(channel, e));
6363
} catch (Exception inner) {
6464
inner.addSuppressed(e);
6565
logger.error("failed to send failure response", inner);

0 commit comments

Comments
 (0)