Skip to content

Search request with body is missing transfer-encoding or content-length #846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zerkms opened this issue Mar 6, 2019 · 1 comment
Closed

Comments

@zerkms
Copy link

zerkms commented Mar 6, 2019

Summary of problem or feature request

It was raised before #737 but closed without further discussion.

It is indeed allowed to send body with GET method.

The problem is that as long as you provide one you must then specify either Content-Length or Transfer-Encoding or both (https://tools.ietf.org/html/rfc7230#section-3.3)

None of those are provided.

So as expected proxies go crazy, since then there is no way to infer the body length, hence return HTTP 411

Code snippet of problem

System details

  • Operating System N/A
  • PHP Version N/A
  • ES-PHP client version 6.1.0
  • Elasticsearch version N/A
@ezimuel
Copy link
Contributor

ezimuel commented Jul 18, 2019

The issue is that for some endpoint we used GET instead of POST also if the body was not empty. I fixed this and released with 5.5.0.
I'm going to release also 6.5.1 and 6.7.2. The 7.0 branch should not be affected by the issue, since I generated the code from the Elasticsearch API specifications.

@ezimuel ezimuel closed this as completed Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants