Skip to content

Commit

Permalink
REST: Remove GET support for clear cache indices (elastic#29525)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
spinscale authored Apr 27, 2018
1 parent e0b8893 commit e1a16a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 4 additions & 1 deletion docs/reference/release-notes/7.0.0-alpha1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ The changes listed below have been released for the first time in Elasticsearch
=== Breaking changes

Core::
* Tribe node has been removed in favor of Cross-Cluster-Search
* Tribe node has been removed in favor of Cross-Cluster-Search

Rest API::
* The Clear Cache API only supports `POST` as HTTP method
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"indices.clear_cache": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html",
"methods": ["POST", "GET"],
"methods": ["POST"],
"url": {
"path": "/_cache/clear",
"paths": ["/_cache/clear", "/{index}/_cache/clear"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

import java.io.IOException;

import static org.elasticsearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestRequest.Method.POST;

public class RestClearIndicesCacheAction extends BaseRestHandler {
Expand All @@ -40,9 +39,6 @@ public RestClearIndicesCacheAction(Settings settings, RestController controller)
super(settings);
controller.registerHandler(POST, "/_cache/clear", this);
controller.registerHandler(POST, "/{index}/_cache/clear", this);

controller.registerHandler(GET, "/_cache/clear", this);
controller.registerHandler(GET, "/{index}/_cache/clear", this);
}

@Override
Expand Down

0 comments on commit e1a16a6

Please sign in to comment.