You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "joyyir (via GitHub)" <gi...@apache.org> on 2023/05/11 10:50:28 UTC

[GitHub] [apisix-java-plugin-runner] joyyir opened a new pull request, #239: feat: supports other charsets

joyyir opened a new pull request, #239:
URL: https://github.com/apache/apisix-java-plugin-runner/pull/239

   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bugfix
   - [V] New feature provided
   - [ ] Improve performance
   
   - Related issues
   #238 
   ___
   ### Bugfix
   - Description
   
   - How to fix?
   
   ___
   ### New feature or improvement
   - Describe the details and related test reports.
   `PostResponse` by default converts the body to bytes in `UTF-8`.
   It would be nice to support other charsets.
   
   - Source branch
   main
   
   - Related commits and pull requests
   
   - Target branch
   main


-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-java-plugin-runner] joyyir commented on pull request #239: feat: `PostResponse` supports charset other than `UTF-8`

Posted by "joyyir (via GitHub)" <gi...@apache.org>.
joyyir commented on PR #239:
URL: https://github.com/apache/apisix-java-plugin-runner/pull/239#issuecomment-1547244543

   Added test case. Thank you.


-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-java-plugin-runner] nic-chen commented on pull request #239: feat: `PostResponse` supports charset other than `UTF-8`

Posted by "nic-chen (via GitHub)" <gi...@apache.org>.
nic-chen commented on PR #239:
URL: https://github.com/apache/apisix-java-plugin-runner/pull/239#issuecomment-1556620052

   @joyyir thanks!


-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-java-plugin-runner] nic-chen commented on a diff in pull request #239: feat: `PostResponse` supports charset other than `UTF-8`

Posted by "nic-chen (via GitHub)" <gi...@apache.org>.
nic-chen commented on code in PR #239:
URL: https://github.com/apache/apisix-java-plugin-runner/pull/239#discussion_r1194797946


##########
runner-plugin-sdk/src/main/java/org/apache/apisix/plugin/runner/PostResponse.java:
##########
@@ -53,7 +57,7 @@ public ByteBuffer encode() {
 
         int bodyIndex = -1;
         if (StringUtils.hasText(body)) {
-            byte[] bodyBytes = body.getBytes(StandardCharsets.UTF_8);
+            byte[] bodyBytes = body.getBytes(charset);

Review Comment:
   ```suggestion
               byte[] bodyBytes = body.getBytes(this.charset);
   ```
   should be better?



-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-java-plugin-runner] nic-chen merged pull request #239: feat: `PostResponse` supports charset other than `UTF-8`

Posted by "nic-chen (via GitHub)" <gi...@apache.org>.
nic-chen merged PR #239:
URL: https://github.com/apache/apisix-java-plugin-runner/pull/239


-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-java-plugin-runner] joyyir commented on a diff in pull request #239: feat: `PostResponse` supports charset other than `UTF-8`

Posted by "joyyir (via GitHub)" <gi...@apache.org>.
joyyir commented on code in PR #239:
URL: https://github.com/apache/apisix-java-plugin-runner/pull/239#discussion_r1199899695


##########
runner-plugin-sdk/src/main/java/org/apache/apisix/plugin/runner/PostResponse.java:
##########
@@ -53,7 +57,7 @@ public ByteBuffer encode() {
 
         int bodyIndex = -1;
         if (StringUtils.hasText(body)) {
-            byte[] bodyBytes = body.getBytes(StandardCharsets.UTF_8);
+            byte[] bodyBytes = body.getBytes(charset);

Review Comment:
   I've reflected your review. Thank you.



-- 
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: notifications-unsubscribe@apisix.apache.org

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