Reveal Content-Length on x-pack info HEAD requests
This commit permits x-pack info HEAD requests to reveal the Content-Length of the response. Relates elastic/elasticsearch#3887 Original commit: elastic/x-pack-elasticsearch@8696caa1f6
This commit is contained in:
parent
0b24f022f7
commit
007e49c5d9
|
@ -50,12 +50,6 @@ public class RestXPackInfoAction extends XPackRestHandler {
|
||||||
@Override
|
@Override
|
||||||
public RestResponse buildResponse(XPackInfoResponse infoResponse, XContentBuilder builder) throws Exception {
|
public RestResponse buildResponse(XPackInfoResponse infoResponse, XContentBuilder builder) throws Exception {
|
||||||
|
|
||||||
// we treat HEAD requests as simple pings to ensure that X-Pack is installed
|
|
||||||
// we still execute the action as we want this request to be authorized
|
|
||||||
if (request.method() == RestRequest.Method.HEAD) {
|
|
||||||
return new BytesRestResponse(OK, builder);
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.startObject();
|
builder.startObject();
|
||||||
|
|
||||||
if (infoResponse.getBuildInfo() != null) {
|
if (infoResponse.getBuildInfo() != null) {
|
||||||
|
|
Loading…
Reference in New Issue