Skip to content

Commit e1a16a6

Browse files
authored
REST: Remove GET support for clear cache indices (#29525)
Clearing the cache indices can be done via GET and POST. As GET should only support read only operations, this removes the support for using GET for clearing the indices caches.
1 parent e0b8893 commit e1a16a6

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

docs/reference/release-notes/7.0.0-alpha1.asciidoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ The changes listed below have been released for the first time in Elasticsearch
88
=== Breaking changes
99

1010
Core::
11-
* Tribe node has been removed in favor of Cross-Cluster-Search
11+
* Tribe node has been removed in favor of Cross-Cluster-Search
12+
13+
Rest API::
14+
* The Clear Cache API only supports `POST` as HTTP method

rest-api-spec/src/main/resources/rest-api-spec/api/indices.clear_cache.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"indices.clear_cache": {
33
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html",
4-
"methods": ["POST", "GET"],
4+
"methods": ["POST"],
55
"url": {
66
"path": "/_cache/clear",
77
"paths": ["/_cache/clear", "/{index}/_cache/clear"],

server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestClearIndicesCacheAction.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
import java.io.IOException;
3333

34-
import static org.elasticsearch.rest.RestRequest.Method.GET;
3534
import static org.elasticsearch.rest.RestRequest.Method.POST;
3635

3736
public class RestClearIndicesCacheAction extends BaseRestHandler {
@@ -40,9 +39,6 @@ public RestClearIndicesCacheAction(Settings settings, RestController controller)
4039
super(settings);
4140
controller.registerHandler(POST, "/_cache/clear", this);
4241
controller.registerHandler(POST, "/{index}/_cache/clear", this);
43-
44-
controller.registerHandler(GET, "/_cache/clear", this);
45-
controller.registerHandler(GET, "/{index}/_cache/clear", this);
4642
}
4743

4844
@Override

0 commit comments

Comments
 (0)