-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
Indexing & SearchbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershacktoberfestGlobal event that encourages people to contribute to open-source.Global event that encourages people to contribute to open-source.
Description
Describe the bug
Create Index API returning wrong http response code when given invalid input.
To Reproduce
- Start up server ./gradlew run
- Send a curl request to create an index with invalid input
curl -v -X PUT "localhost:9200/test-index?pretty" -H 'Content-Type: application/json' -d'
adksjhfakldhsf
'
Response:
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9200 (#0)
> PUT /test-index?pretty HTTP/1.1
> Host: localhost:9200
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 16
>
* upload completely sent off: 16 out of 16 bytes
< HTTP/1.1 500 Internal Server Error
< content-type: application/json; charset=UTF-8
< content-length: 390
<
{
"error" : {
"root_cause" : [
{
"type" : "not_x_content_exception",
"reason" : "Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"
}
],
"type" : "not_x_content_exception",
"reason" : "Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"
},
"status" : 500
}
* Connection #0 to host localhost left intact
* Closing connection 0
Expected behavior
This should return http 400 Bad Request.
Plugins
None
Host/Environment (please complete the following information):
- OS: [e.g. iOS]. Mac
- Version [e.g. 22] 2.1.0 (current main)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Indexing & SearchbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershacktoberfestGlobal event that encourages people to contribute to open-source.Global event that encourages people to contribute to open-source.