From 08d02ead134ee9a318ccbd58d8465d40378dbf76 Mon Sep 17 00:00:00 2001 From: Yann Tavernier Date: Fri, 10 Feb 2023 07:54:21 +0100 Subject: [PATCH] fix(api): send head before writing response for /monitor --- .../node/monitoring/monitor/NodeMonitorManagementEndpoint.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gravitee-node-monitoring/src/main/java/io/gravitee/node/monitoring/monitor/NodeMonitorManagementEndpoint.java b/gravitee-node-monitoring/src/main/java/io/gravitee/node/monitoring/monitor/NodeMonitorManagementEndpoint.java index 1c144d7e4..ed7368239 100644 --- a/gravitee-node-monitoring/src/main/java/io/gravitee/node/monitoring/monitor/NodeMonitorManagementEndpoint.java +++ b/gravitee-node-monitoring/src/main/java/io/gravitee/node/monitoring/monitor/NodeMonitorManagementEndpoint.java @@ -70,8 +70,8 @@ public void handle(RoutingContext context) { response.putHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); response.setChunked(true); - response.write(mapper.writeValueAsString(root)); response.setStatusCode(HttpStatusCode.OK_200); + response.write(mapper.writeValueAsString(root)); } catch (JsonProcessingException e) { LOGGER.error("Unexpected error while generating monitoring", e); response.setStatusCode(HttpStatusCode.INTERNAL_SERVER_ERROR_500);