diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/main/RestMainAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/main/RestMainAction.java index ce699b82cb1..c0178a47e03 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/main/RestMainAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/main/RestMainAction.java @@ -64,10 +64,15 @@ public class RestMainAction extends BaseRestHandler { this.quotesSize = quotesSize; controller.registerHandler(GET, "/", this); + controller.registerHandler(HEAD, "/", this); } @Override public void handleRequest(RestRequest request, RestChannel channel) { try { + if (request.method() == RestRequest.Method.HEAD) { + channel.sendResponse(new StringRestResponse(RestResponse.Status.OK)); + return; + } XContentBuilder builder = RestXContentBuilder.restContentBuilder(request).prettyPrint(); builder.startObject(); builder.field("ok", true);