even on failure, don't return a body for HEAD request
This commit is contained in:
parent
0ed50ca00c
commit
260c61266d
|
@ -31,9 +31,6 @@ import org.elasticsearch.rest.RestChannel;
|
||||||
import org.elasticsearch.rest.RestController;
|
import org.elasticsearch.rest.RestController;
|
||||||
import org.elasticsearch.rest.RestRequest;
|
import org.elasticsearch.rest.RestRequest;
|
||||||
import org.elasticsearch.rest.StringRestResponse;
|
import org.elasticsearch.rest.StringRestResponse;
|
||||||
import org.elasticsearch.rest.XContentThrowableRestResponse;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import static org.elasticsearch.rest.RestRequest.Method.*;
|
import static org.elasticsearch.rest.RestRequest.Method.*;
|
||||||
import static org.elasticsearch.rest.RestStatus.*;
|
import static org.elasticsearch.rest.RestStatus.*;
|
||||||
|
@ -73,8 +70,8 @@ public class RestIndicesExistsAction extends BaseRestHandler {
|
||||||
|
|
||||||
@Override public void onFailure(Throwable e) {
|
@Override public void onFailure(Throwable e) {
|
||||||
try {
|
try {
|
||||||
channel.sendResponse(new XContentThrowableRestResponse(request, e));
|
channel.sendResponse(new StringRestResponse(INTERNAL_SERVER_ERROR));
|
||||||
} catch (IOException e1) {
|
} catch (Exception e1) {
|
||||||
logger.error("Failed to send failure response", e1);
|
logger.error("Failed to send failure response", e1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue