fix #2540 check a size of request body

This commit is contained in:
Shinsuke Sugaya 2021-03-07 17:54:55 +09:00
parent 2758ed9d30
commit 9b6ec3a8f3

View file

@ -141,7 +141,7 @@ public class EsApiManager extends BaseApiManager {
});
try (final CurlResponse curlResponse = curlRequest.onConnect((req, con) -> {
con.setDoOutput(true);
if (httpMethod != Method.GET) {
if (httpMethod != Method.GET && request.getContentLength() > 2) {
try (ServletInputStream in = request.getInputStream(); OutputStream out = con.getOutputStream()) {
CopyUtil.copy(in, out);
} catch (final IOException e) {