You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by "ChelseaChanu (via GitHub)" <gi...@apache.org> on 2023/02/22 12:09:53 UTC

[GitHub] [incubator-eventmesh] ChelseaChanu opened a new pull request, #3241: [ISSUE #3013] conversion between string and byte, charset explicitly …

ChelseaChanu opened a new pull request, #3241:
URL: https://github.com/apache/incubator-eventmesh/pull/3241

   …specified
   
   <!--
   ### Contribution Checklist
   
     - Name the pull request in the form "[ISSUE #XXXX] Title of the pull request", 
       where *XXXX* should be replaced by the actual issue number.
       Skip *[ISSUE #XXXX]* if there is no associated github issue for this pull request.
   
     - Fill out the template below to describe the changes contributed by the pull request. 
       That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue. 
       Please do not mix up code from multiple issues.
     
     - Each commit in the pull request should have a meaningful commit message.
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, 
       leaving only the filled out template below.
   
   (The sections below can be removed for hotfixes of typos)
   -->
   
   <!--
   (If this PR fixes a GitHub issue, please add `Fixes #<XXX>` or `Closes #<XXX>`.)
   -->
   
   Fixes #<3013>.
   ### Modifications
   
   *Describe the modifications you've done.*
   explicitly specify charset, string conversion to bytes
   


-- 
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: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] Alonexc commented on a diff in pull request #3241: [ISSUE #3013] conversion between string and byte, charset explicitly …

Posted by "Alonexc (via GitHub)" <gi...@apache.org>.
Alonexc commented on code in PR #3241:
URL: https://github.com/apache/incubator-eventmesh/pull/3241#discussion_r1115186327


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/ConfigurationHandler.java:
##########
@@ -103,8 +103,9 @@ void get(HttpExchange httpExchange) throws IOException {
                 );
 
                 String result = JsonUtils.toJSONString(getConfigurationResponse);
-                httpExchange.sendResponseHeaders(200, result.getBytes().length);
-                out.write(result.getBytes());
+                byte bytes[] = result.getBytes(Constants.DEFAULT_CHARSET);

Review Comment:
   Here should be:
   byte[] bytes = result.getBytes(Constants.DEFAULT_CHARSET)
   



-- 
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: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] Alonexc commented on a diff in pull request #3241: [ISSUE #3013] conversion between string and byte, charset explicitly …

Posted by "Alonexc (via GitHub)" <gi...@apache.org>.
Alonexc commented on code in PR #3241:
URL: https://github.com/apache/incubator-eventmesh/pull/3241#discussion_r1115187084


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/ConfigurationHandler.java:
##########
@@ -103,8 +103,9 @@ void get(HttpExchange httpExchange) throws IOException {
                 );
 
                 String result = JsonUtils.toJSONString(getConfigurationResponse);
-                httpExchange.sendResponseHeaders(200, result.getBytes().length);
-                out.write(result.getBytes());
+                byte bytes[] = result.getBytes(Constants.DEFAULT_CHARSET);

Review Comment:
   And the import is missing:
   import org.apache.eventmesh.common.Constants;



-- 
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: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] Alonexc commented on a diff in pull request #3241: [ISSUE #3013] conversion between string and byte, charset explicitly …

Posted by "Alonexc (via GitHub)" <gi...@apache.org>.
Alonexc commented on code in PR #3241:
URL: https://github.com/apache/incubator-eventmesh/pull/3241#discussion_r1115186408


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/ConfigurationHandler.java:
##########
@@ -114,8 +115,9 @@ void get(HttpExchange httpExchange) throws IOException {
 
                 Error error = new Error(e.toString(), stackTrace);
                 String result = JsonUtils.toJSONString(error);
-                httpExchange.sendResponseHeaders(500, result.getBytes().length);
-                out.write(result.getBytes());
+                byte bytes[] = result.getBytes(Constants.DEFAULT_CHARSET);

Review Comment:
   byte[] bytes = result.getBytes(Constants.DEFAULT_CHARSET)



-- 
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: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


Re: [PR] [ISSUE #3013] Found reliance on default encoding: String.getBytes() [ConfigurationHandler] (eventmesh)

Posted by "pandaapo (via GitHub)" <gi...@apache.org>.
pandaapo closed pull request #3241: [ISSUE #3013] Found reliance on default encoding: String.getBytes() [ConfigurationHandler]
URL: https://github.com/apache/eventmesh/pull/3241


-- 
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: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] Alonexc commented on pull request #3241: [ISSUE #3013] conversion between string and byte, charset explicitly …

Posted by "Alonexc (via GitHub)" <gi...@apache.org>.
Alonexc commented on PR #3241:
URL: https://github.com/apache/incubator-eventmesh/pull/3241#issuecomment-1441149488

   > …specified
   > 
   > Fixes #<3013>.
   > 
   > ### Modifications
   > _Describe the modifications you've done._ explicitly specify charset, string conversion to bytes
   
   Fixes #<3013> To remove '<>', you need to fill in #XXXX to associate it.


-- 
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: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


Re: [PR] [ISSUE #3013] Found reliance on default encoding: String.getBytes() [ConfigurationHandler] (eventmesh)

Posted by "pandaapo (via GitHub)" <gi...@apache.org>.
pandaapo commented on PR #3241:
URL: https://github.com/apache/eventmesh/pull/3241#issuecomment-1818169428

   Thanks for your work. Fixed in #3777.


-- 
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: issues-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org