Skip to content
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

Warning: 299 Elasticsearch-5.6.3-1a2f265 "Content type detection for rest requests is deprecated. Specify the content type using the [Content-Type] header." #633

Closed
jsiembida opened this issue Nov 9, 2017 · 5 comments

Comments

@jsiembida
Copy link

jsiembida commented Nov 9, 2017

Please use the following questions as a guideline to help me answer
your issue/question without further inquiry. Thank you.

Which version of Elastic are you using?

[ ] elastic.v2 (for Elasticsearch 1.x)
[ ] elastic.v3 (for Elasticsearch 2.x)
[x] elastic.v5 (for Elasticsearch 5.x)
[ ] elastic.v6 (for Elasticsearch 6.x)

Please describe the expected behavior

HTTP reply without the titular warning (seems similar to #511)

Please describe the actual behavior

HTTP reply with the warning

Any steps to reproduce the behavior?

Send /_bulk index with Content-Type: application/x-ndjson; charset=UTF-8 instead of Content-Type: application/x-ndjson (seems the charset=UTF-8 triggers the warning).

Example call:

POST /_bulk HTTP/1.1
Host: metrics
Accept-Encoding: identity
Content-Length: 2213
Content-Type: application/x-ndjson; charset=UTF-8

Reply:

HTTP/1.1 200 OK
Warning: 299 Elasticsearch-5.6.3-1a2f265 "Content type detection for rest requests is deprecated. Specify the content type using the [Content-Type] header." "Thu, 09 Nov 2017 12:27:08 GMT"
content-type: application/json; charset=UTF-8
content-length: 1492

Again, removing the charset=UTF-8 makes the warning go:

POST /_bulk HTTP/1.1
Host: metrics
Accept-Encoding: identity
Content-Length: 2213
Content-Type: application/x-ndjson

And the clean reply now:

HTTP/1.1 200 OK
content-type: application/json; charset=UTF-8
content-length: 1492

Not sure that is expected, especially that ES itself uses charset=UTF-8 in replies.

@olivere
Copy link
Owner

olivere commented Nov 9, 2017

Oh, okay. I'll have a look into this for the next release.

@olivere
Copy link
Owner

olivere commented Nov 15, 2017

@jsiembida I don't see how/where Elastic will send Content-Type: application/x-ndjson; charset=UTF-8 anywhere? It will only send Content-Type: application/x-ndjson.

Can you explain how you triggered this?

@olivere
Copy link
Owner

olivere commented Nov 15, 2017

That's also what ES specifies here.

@olivere
Copy link
Owner

olivere commented Nov 17, 2017

@jsiembida Friendly ping.

@jsiembida
Copy link
Author

Hi, thanks for feedback. I think you are absolutely right, this seems more like an ES issue.

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