Skip to content

Commit

Permalink
Also allow test_grok_pattern's content passed by query param (#104714)
Browse files Browse the repository at this point in the history
Fixes: #104708
  • Loading branch information
jan-elastic authored Jan 24, 2024
1 parent 1c29d6e commit 324d35f
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.elasticsearch.rest.ServerlessScope;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xcontent.XContentParser;
import org.elasticsearch.xpack.core.textstructure.action.FindStructureAction;
import org.elasticsearch.xpack.core.textstructure.action.TestGrokPatternAction;

import java.io.IOException;
Expand All @@ -40,8 +39,8 @@ public List<Route> routes() {
@Override
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
TestGrokPatternAction.Request request;
String ecsCompatibility = restRequest.param(FindStructureAction.Request.ECS_COMPATIBILITY.getPreferredName());
try (XContentParser parser = restRequest.contentParser()) {
String ecsCompatibility = restRequest.param(TestGrokPatternAction.Request.ECS_COMPATIBILITY.getPreferredName());
try (XContentParser parser = restRequest.contentOrSourceParamParser()) {
request = TestGrokPatternAction.Request.parseRequest(ecsCompatibility, parser);
}

Expand Down

0 comments on commit 324d35f

Please sign in to comment.