node-elasticsearch-client icon indicating copy to clipboard operation
node-elasticsearch-client copied to clipboard

Content-Length header is absent

Open droganov opened this issue 11 years ago • 2 comments

Module sends invalid request wich make it unusable if we place elastic behind ngnx.

As we run:

elasticSearchClient.createIndex("test_index")
    .on('data', function(data) {
        console.log("results -->");
        console.log(data);
    }).exec();

We get:

<html>
<head><title>411 Length Required</title></head>
<body bgcolor="white">
<center><h1>411 Length Required</h1></center>
<hr><center>nginx</center>
</body>
</html>

droganov avatar Mar 19 '13 11:03 droganov

Hrm, we use it behind nginx in prod. Also Line 86: https://github.com/phillro/node-elasticsearch-client/blob/master/lib/elasticsearchclient/calls/elasticSearchCall.js

However I try to reproduce.

On Tue, Mar 19, 2013 at 7:37 AM, droganov [email protected] wrote:

Module sends invalid request wich make it unusable if we place elastic behind ngnx.

As we run:

elasticSearchClient.createIndex("test_index") .on('data', function(data) { console.log("results -->"); console.log(data); }).exec();

We get:

411 Length Required

411 Length Required


nginx

— Reply to this email directly or view it on GitHubhttps://github.com/phillro/node-elasticsearch-client/issues/64 .

phillro avatar Mar 19 '13 15:03 phillro

in line 81: if this.params.data is null (default settings for index) --> no header Content-Length.

plusbpm avatar Mar 19 '13 17:03 plusbpm