arsenalzp commented on code in PR #4755:
URL: https://github.com/apache/eventmesh/pull/4755#discussion_r1460951662


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/MetaHandler.java:
##########
@@ -120,29 +119,34 @@ void get(HttpExchange httpExchange) throws IOException {
             httpExchange.sendResponseHeaders(200, 
Objects.requireNonNull(result).getBytes(Constants.DEFAULT_CHARSET).length);
             out.write(result.getBytes(Constants.DEFAULT_CHARSET));
         } catch (NullPointerException e) {
-            // registry not initialized, return empty list
-            String result = JsonUtils.toJSONString(new ArrayList<>());
-            httpExchange.sendResponseHeaders(200, 
Objects.requireNonNull(result).getBytes(Constants.DEFAULT_CHARSET).length);
-            out.write(result.getBytes(Constants.DEFAULT_CHARSET));
+            try (OutputStream out = httpExchange.getResponseBody()) {
+                // registry not initialized, return empty list
+                String result = JsonUtils.toJSONString(new ArrayList<>());

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to