Just started with a new small project with Elasticsearch, while developing Elasticsearch it is currently running in Docker (docker-elk), with the added "http.cors" things:
http.cors.enabled: true
http.cors.allow-origin: "https://app.elasticvue.com"
http.cors.allow-headers: X-Requested-With,Content-Type,Content-Length,Authorization
Since version 8.0.3 it will send REST API compatibility headers:
Release notes v8.0.3 | Elasticsearch .NET Client [8.0] | Elastic
REST API compatibility | Elasticsearch Guide [8.5] | Elastic
Somehow it doesn't correctly retrieve/send the correct version, and Elasticsearch returns a 400 Bad Request because of this.
Maybe the same is/was in the Java version? PR on GitHub, but I'm not sure.
This is the response I get is:
{
"error": {
"root_cause": [
{
"type": "media_type_header_exception",
"reason": "Invalid media-type value on headers [Accept, Content-Type]"
}
],
"type": "media_type_header_exception",
"reason": "Invalid media-type value on headers [Accept, Content-Type]",
"caused_by": {
"type": "status_exception",
"reason": "Accept version must be either version 8 or 7, but found 0. Accept=application/vnd.elasticsearch+json;compatible-with=0"
}
},
"status": 400
}
So it doesn't see a version.
When running it in a testcase, it works. But when deployed it doesn't.
The .NET version is, sadly, .NET Framework 4.8, which is a limitation, cannot upgrade it to .NET (Core) because it's a SAAS.
When I revert back to 8.0.2, it works fine.
Should I make a bug on GitHub?
Kind regards!