lib/elasticsearch/api/actions/cluster/allocation_explain.rb in elasticsearch-api-8.1.0 vs lib/elasticsearch/api/actions/cluster/allocation_explain.rb in elasticsearch-api-8.1.2

- 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/8.1/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