diff --git a/server/src/main/java/com/epam/aidial/core/server/controller/DeploymentFeatureController.java b/server/src/main/java/com/epam/aidial/core/server/controller/DeploymentFeatureController.java index 5c721aa4..29ecc8ce 100644 --- a/server/src/main/java/com/epam/aidial/core/server/controller/DeploymentFeatureController.java +++ b/server/src/main/java/com/epam/aidial/core/server/controller/DeploymentFeatureController.java @@ -34,7 +34,8 @@ public DeploymentFeatureController(Proxy proxy, ProxyContext context) { } public Future handle(String deploymentId, Function endpointGetter, boolean requireEndpoint) { - DeploymentController.selectDeployment(context, deploymentId).map(dep -> { + // make sure request.body() called before request.resume() + return DeploymentController.selectDeployment(context, deploymentId).map(dep -> { String endpoint = endpointGetter.apply(dep); context.setDeployment(dep); context.getRequest().body() @@ -45,8 +46,6 @@ public Future handle(String deploymentId, Function endpoi handleRequestError(deploymentId, error); return null; }); - - return Future.succeededFuture(); } @SneakyThrows