This is an automated email from the ASF dual-hosted git repository.

mytang0 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new a47fb40ff Added fix for issue apache#3008.
     new c9143d153 Merge pull request #3533 from sanskar-thakur/fix-3008
a47fb40ff is described below

commit a47fb40ffc82fb6bbeb33440cf419869272d47dc
Author: Zaar <[email protected]>
AuthorDate: Mon Mar 27 23:04:41 2023 +0530

    Added fix for issue apache#3008.
---
 .../eventmesh/runtime/admin/handler/HTTPClientHandler.java    | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/HTTPClientHandler.java
 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/HTTPClientHandler.java
index 8f146f808..3bb4b1006 100644
--- 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/HTTPClientHandler.java
+++ 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/HTTPClientHandler.java
@@ -74,8 +74,7 @@ public class HTTPClientHandler extends AbstractHttpHandler {
      * DELETE /client/http
      */
     void delete(HttpExchange httpExchange) throws IOException {
-        OutputStream out = httpExchange.getResponseBody();
-        try {
+        try (OutputStream out = httpExchange.getResponseBody()) {
             String request = 
HttpExchangeUtils.streamToString(httpExchange.getRequestBody());
             DeleteHTTPClientRequest deleteHTTPClientRequest = 
JsonUtils.parseObject(request, DeleteHTTPClientRequest.class);
             String url = deleteHTTPClientRequest.getUrl();
@@ -97,14 +96,6 @@ public class HTTPClientHandler extends AbstractHttpHandler {
             String result = JsonUtils.toJSONString(error);
             httpExchange.sendResponseHeaders(500, result.getBytes().length);
             out.write(result.getBytes());
-        } finally {
-            if (out != null) {
-                try {
-                    out.close();
-                } catch (IOException e) {
-                    log.warn("out close failed...", e);
-                }
-            }
         }
     }
 


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

Reply via email to