lib/elasticsearch/api/actions/cluster/allocation_explain.rb in elasticsearch-api-8.0.0 vs lib/elasticsearch/api/actions/cluster/allocation_explain.rb in elasticsearch-api-8.0.1

- old
+ new

@@ -27,14 +27,13 @@ # @option arguments [Hash] :body The index, shard, and primary flag to explain. Empty means 'explain a randomly-chosen unassigned shard' # # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html # def allocation_explain(arguments = {}) + arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) - - arguments = arguments.clone + body = arguments.delete(:body) method = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET