You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/05/30 08:36:27 UTC

[GitHub] [servicecomb-java-chassis] wujimin opened a new pull request #1800: [SCB-1961] add rest server codec filter

wujimin opened a new pull request #1800:
URL: https://github.com/apache/servicecomb-java-chassis/pull/1800


   


----------------------------------------------------------------
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.

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



[GitHub] [servicecomb-java-chassis] coveralls commented on pull request #1800: [SCB-1961] add rest server codec filter

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #1800:
URL: https://github.com/apache/servicecomb-java-chassis/pull/1800#issuecomment-636302742


   
   [![Coverage Status](https://coveralls.io/builds/31131288/badge)](https://coveralls.io/builds/31131288)
   
   Coverage increased (+0.04%) to 86.639% when pulling **c993403303c36de476bc30112b489e387e335699 on wujimin:SCB-1961-add-rest-server-codec-filter** into **46379811f2cf580ee2f1913dca62fd0b74f57304 on apache:master**.
   


----------------------------------------------------------------
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.

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



[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #1800: [SCB-1961] add rest server codec filter

Posted by GitBox <gi...@apache.org>.
liubao68 commented on a change in pull request #1800:
URL: https://github.com/apache/servicecomb-java-chassis/pull/1800#discussion_r432825525



##########
File path: common/common-rest/src/main/java/org/apache/servicecomb/common/rest/AbstractRestInvocation.java
##########
@@ -268,16 +268,8 @@ protected void sendResponseQuietly(Response response) {
 
   @SuppressWarnings("deprecation")
   protected void sendResponse(Response response) {
-    if (response.getHeaders().getHeaderMap() != null) {
-      for (Entry<String, List<Object>> entry : response.getHeaders().getHeaderMap().entrySet()) {
-        for (Object value : entry.getValue()) {
-          if (!entry.getKey().equalsIgnoreCase(HttpHeaders.CONTENT_LENGTH)
-              && !entry.getKey().equalsIgnoreCase("Transfer-Encoding")) {
-            responseEx.addHeader(entry.getKey(), String.valueOf(value));
-          }
-        }
-      }
-    }
+    RestServerCodecFilter.encodeHeader(response.getHeaders().getHeaderMap(), responseEx);

Review comment:
       `encodeHeader` name is not good. It's do not do any encoding. 




----------------------------------------------------------------
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.

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



[GitHub] [servicecomb-java-chassis] wujimin merged pull request #1800: [SCB-1961] add rest server codec filter

Posted by GitBox <gi...@apache.org>.
wujimin merged pull request #1800:
URL: https://github.com/apache/servicecomb-java-chassis/pull/1800


   


----------------------------------------------------------------
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.

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



[GitHub] [servicecomb-java-chassis] coveralls edited a comment on pull request #1800: [SCB-1961] add rest server codec filter

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #1800:
URL: https://github.com/apache/servicecomb-java-chassis/pull/1800#issuecomment-636302742


   
   [![Coverage Status](https://coveralls.io/builds/31131614/badge)](https://coveralls.io/builds/31131614)
   
   Coverage increased (+0.04%) to 86.639% when pulling **c3491e35f6e24d90e33db9c7ef22205658ac3351 on wujimin:SCB-1961-add-rest-server-codec-filter** into **46379811f2cf580ee2f1913dca62fd0b74f57304 on apache:master**.
   


----------------------------------------------------------------
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.

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



[GitHub] [servicecomb-java-chassis] wujimin commented on a change in pull request #1800: [SCB-1961] add rest server codec filter

Posted by GitBox <gi...@apache.org>.
wujimin commented on a change in pull request #1800:
URL: https://github.com/apache/servicecomb-java-chassis/pull/1800#discussion_r432832885



##########
File path: common/common-rest/src/main/java/org/apache/servicecomb/common/rest/AbstractRestInvocation.java
##########
@@ -268,16 +268,8 @@ protected void sendResponseQuietly(Response response) {
 
   @SuppressWarnings("deprecation")
   protected void sendResponse(Response response) {
-    if (response.getHeaders().getHeaderMap() != null) {
-      for (Entry<String, List<Object>> entry : response.getHeaders().getHeaderMap().entrySet()) {
-        for (Object value : entry.getValue()) {
-          if (!entry.getKey().equalsIgnoreCase(HttpHeaders.CONTENT_LENGTH)
-              && !entry.getKey().equalsIgnoreCase("Transfer-Encoding")) {
-            responseEx.addHeader(entry.getKey(), String.valueOf(value));
-          }
-        }
-      }
-    }
+    RestServerCodecFilter.encodeHeader(response.getHeaders().getHeaderMap(), responseEx);

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.

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