-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
Description
On a cluster with no x-pack and version 6.2.4:
POST http://127.0.0.1:9200/_xpack/migration/upgrade/.watches HTTP/1.1
Connection: Keep-Alive
Accept: application/json
Content-Length: 0
Host: 127.0.0.1:9200
HTTP/1.1 400 Bad Request
content-type: text/plain; charset=UTF-8
content-length: 79
No handler found for uri [/_xpack/migration/upgrade/.watches] and method [POST]
Ideally it returns application/json as requested by the Accept header. This is how we currently return 405 and 406
POST http://127.0.0.1:9200/_blah HTTP/1.1
Connection: Keep-Alive
Accept: application/json
Content-Length: 0
Host: 127.0.0.1:9200
{"error":"Incorrect HTTP method for uri [/_blah] and method [POST], allowed: [HEAD, DELETE, PUT, GET]","status":405}
One could also argue it should not be a 400 but a 404 if the resource does not exist:
GET http://127.0.0.1:9200/_nodes/safdasd/asdasd/sadasd HTTP/1.1
Connection: Keep-Alive
Accept: application/json
Content-Length: 0
Host: 127.0.0.1:9200
No handler found for uri [/_nodes/safdasd/asdasd/sadasd] and method [GET]