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 09:13:33 UTC

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

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