handle rest HEAD on / path
This commit is contained in:
parent
b1d13febbf
commit
7359f7983f
|
@ -64,10 +64,15 @@ public class RestMainAction extends BaseRestHandler {
|
||||||
this.quotesSize = quotesSize;
|
this.quotesSize = quotesSize;
|
||||||
|
|
||||||
controller.registerHandler(GET, "/", this);
|
controller.registerHandler(GET, "/", this);
|
||||||
|
controller.registerHandler(HEAD, "/", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void handleRequest(RestRequest request, RestChannel channel) {
|
@Override public void handleRequest(RestRequest request, RestChannel channel) {
|
||||||
try {
|
try {
|
||||||
|
if (request.method() == RestRequest.Method.HEAD) {
|
||||||
|
channel.sendResponse(new StringRestResponse(RestResponse.Status.OK));
|
||||||
|
return;
|
||||||
|
}
|
||||||
XContentBuilder builder = RestXContentBuilder.restContentBuilder(request).prettyPrint();
|
XContentBuilder builder = RestXContentBuilder.restContentBuilder(request).prettyPrint();
|
||||||
builder.startObject();
|
builder.startObject();
|
||||||
builder.field("ok", true);
|
builder.field("ok", true);
|
||||||
|
|
Loading…
Reference in New Issue