Skip to content

Commit 4a07eed

Browse files
author
Christoph Büscher
committed
iter
1 parent 7b46b5f commit 4a07eed

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
import org.elasticsearch.rest.action.RestToXContentListener;
3434

3535
import java.io.IOException;
36+
import java.util.Collections;
3637
import java.util.Set;
38+
import java.util.stream.Collectors;
39+
import java.util.stream.Stream;
3740

3841
import static org.elasticsearch.rest.RestRequest.Method.GET;
3942
import static org.elasticsearch.rest.RestRequest.Method.HEAD;
@@ -47,6 +50,9 @@ public class RestGetIndicesAction extends BaseRestHandler {
4750
static final String TYPES_DEPRECATION_MESSAGE = "[types removal] Using `include_type_name` in get indices requests is deprecated. "
4851
+ "The parameter will be removed in the next major version.";
4952

53+
private static final Set<String> allowedResponseParameters = Collections.unmodifiableSet(Stream
54+
.concat(Collections.singleton("include_type_name").stream(), Settings.FORMAT_PARAMS.stream()).collect(Collectors.toSet()));
55+
5056
public RestGetIndicesAction(
5157
final Settings settings,
5258
final RestController controller) {
@@ -77,9 +83,12 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC
7783
return channel -> client.admin().indices().getIndex(getIndexRequest, new RestToXContentListener<>(channel));
7884
}
7985

86+
/**
87+
* Parameters used for controlling the response and thus might not be consumed during
88+
* preparation of the request execution in {@link BaseRestHandler#prepareRequest(RestRequest, NodeClient)}.
89+
*/
8090
@Override
8191
protected Set<String> responseParams() {
82-
return Settings.FORMAT_PARAMS;
92+
return allowedResponseParameters;
8393
}
84-
8594
}

0 commit comments

Comments
 (0)