Skip to content

Commit

Permalink
Also allow test_grok_pattern's content passed by query param (elastic…
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-elastic authored and henningandersen committed Jan 25, 2024
1 parent 66a0fd3 commit 2a34984
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 2a34984

Please sign in to comment.