diff --git a/src/main/java/org/elasticsearch/rest/RestController.java b/src/main/java/org/elasticsearch/rest/RestController.java index e852e76c2f5..620c8229b25 100644 --- a/src/main/java/org/elasticsearch/rest/RestController.java +++ b/src/main/java/org/elasticsearch/rest/RestController.java @@ -209,6 +209,7 @@ public class RestController extends AbstractLifecycleComponent { public void continueProcessing(RestRequest request, RestChannel channel) { try { int loc = index; + index++; if (loc > filters.length) { throw new ElasticSearchIllegalStateException("filter continueProcessing was called more than expected"); } else if (loc == filters.length) { @@ -217,7 +218,6 @@ public class RestController extends AbstractLifecycleComponent { RestFilter preProcessor = filters[loc]; preProcessor.process(request, channel, this); } - index++; } catch (Exception e) { try { channel.sendResponse(new XContentThrowableRestResponse(request, e));