Handle pretty=false and missing line feed for pretty=true which is the default for main REST action
This commit is contained in:
parent
59f1ce5ada
commit
00be285c26
|
@ -54,6 +54,9 @@ public class RestMainAction extends BaseRestHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleRequest(final RestRequest request, final RestChannel channel) {
|
public void handleRequest(final RestRequest request, final RestChannel channel) {
|
||||||
|
if (!request.hasParam("pretty")) {
|
||||||
|
request.params().put("pretty", "true");
|
||||||
|
}
|
||||||
ClusterStateRequest clusterStateRequest = new ClusterStateRequest();
|
ClusterStateRequest clusterStateRequest = new ClusterStateRequest();
|
||||||
clusterStateRequest.listenerThreaded(false);
|
clusterStateRequest.listenerThreaded(false);
|
||||||
clusterStateRequest.masterNodeTimeout(TimeValue.timeValueMillis(0));
|
clusterStateRequest.masterNodeTimeout(TimeValue.timeValueMillis(0));
|
||||||
|
@ -72,7 +75,7 @@ public class RestMainAction extends BaseRestHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
XContentBuilder builder = RestXContentBuilder.restContentBuilder(request).prettyPrint();
|
XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
|
||||||
builder.startObject();
|
builder.startObject();
|
||||||
builder.field("ok", true);
|
builder.field("ok", true);
|
||||||
builder.field("status", status.getStatus());
|
builder.field("status", status.getStatus());
|
||||||
|
|
Loading…
Reference in New Issue