Open
Description
Which version of Elastic are you using?
[X] elastic.v7 (for Elasticsearch 7.x)
[ ] elastic.v6 (for Elasticsearch 6.x)
[ ] elastic.v5 (for Elasticsearch 5.x)
[ ] elastic.v3 (for Elasticsearch 2.x)
[ ] elastic.v2 (for Elasticsearch 1.x)
Please describe the expected behavior
ELK search sends an HTTP request with a "Content-Length: nnn" header.
Please describe the actual behavior
ELK search sends an HTTP request with a "Transfer-Encoding: chunked" header.
Transfer-Encoding chunked can be used in a HTTP request but is rarely used and this can cause problems to other tools.
Any steps to reproduce the behavior?
Reproduced in any search request.
The problem is in request.go, in func setBodyHeader(). When called in setBodyJson() or setBodyGzip(), the body is a bytes.Reader, then it must be converted to a bytes.Reader and not a bytes.Buffer to get the ContentLength.
Metadata
Metadata
Assignees
Labels
No labels