Closed
Description
Currently when we convert a low-level netty http method to an elasticsearch http method we consider an unknown request type to be a GET
request.
public Method method() {
HttpMethod httpMethod = request.method();
if (httpMethod == HttpMethod.GET)
return Method.GET;
if (httpMethod == HttpMethod.POST)
return Method.POST;
if (httpMethod == HttpMethod.PUT)
return Method.PUT;
if (httpMethod == HttpMethod.DELETE)
return Method.DELETE;
if (httpMethod == HttpMethod.HEAD) {
return Method.HEAD;
}
if (httpMethod == HttpMethod.OPTIONS) {
return Method.OPTIONS;
}
return Method.GET;
}
Currently that means that PATCH
, TRACE
, and CONNECT
methods are treated as GET
methods by elasticsearch. If we do not plan on supporting these methods, we should just return a 405 instead of silently pretending that these are GET
requests.