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

mikexue 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 98b5475d8 [ISSUE #3013] Updated ConfigurationHandler.java  (#3777)
98b5475d8 is described below

commit 98b5475d8933cd879d6fe414f28f620a4431835a
Author: Piyush <[email protected]>
AuthorDate: Thu May 4 07:15:24 2023 +0530

    [ISSUE #3013] Updated ConfigurationHandler.java  (#3777)
    
    * Updated ConfigurationHandler.java #3013
    
    * Update ConfigurationHandler.java
    
    * Update ConfigurationHandler.java
    
    ---------
    
    Co-authored-by: mike_xwm <[email protected]>
---
 .../eventmesh/runtime/admin/handler/ConfigurationHandler.java    | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/ConfigurationHandler.java
 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/ConfigurationHandler.java
index e9b549a2d..14e7a4261 100644
--- 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/ConfigurationHandler.java
+++ 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/ConfigurationHandler.java
@@ -17,6 +17,7 @@
 
 package org.apache.eventmesh.runtime.admin.handler;
 
+import org.apache.eventmesh.common.Constants;
 import org.apache.eventmesh.common.utils.JsonUtils;
 import org.apache.eventmesh.runtime.admin.controller.HttpHandlerManager;
 import org.apache.eventmesh.runtime.admin.response.Error;
@@ -102,8 +103,8 @@ public class ConfigurationHandler extends 
AbstractHttpHandler {
                 );
 
                 String result = 
JsonUtils.toJSONString(getConfigurationResponse);
-                httpExchange.sendResponseHeaders(200, 
result.getBytes().length);
-                out.write(result.getBytes());
+                httpExchange.sendResponseHeaders(200, 
result.getBytes(Constants.DEFAULT_CHARSET).length);
+                out.write(result.getBytes(Constants.DEFAULT_CHARSET));
             } catch (Exception e) {
                 StringWriter writer = new StringWriter();
                 PrintWriter printWriter = new PrintWriter(writer);
@@ -113,8 +114,8 @@ public class ConfigurationHandler extends 
AbstractHttpHandler {
 
                 Error error = new Error(e.toString(), stackTrace);
                 String result = JsonUtils.toJSONString(error);
-                httpExchange.sendResponseHeaders(500, 
result.getBytes().length);
-                out.write(result.getBytes());
+                httpExchange.sendResponseHeaders(500, 
result.getBytes(Constants.DEFAULT_CHARSET).length);
+                out.write(result.getBytes(Constants.DEFAULT_CHARSET));
             }
         }
     }


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

Reply via email to