You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/01/07 03:19:20 UTC

[GitHub] YorkShen closed pull request #1300: [WEEX-482][Android] Added support for multi-value headers(WXStreamModule)

YorkShen closed pull request #1300: [WEEX-482][Android] Added support for multi-value headers(WXStreamModule)
URL: https://github.com/apache/incubator-weex/pull/1300
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/android/sdk/src/main/java/com/taobao/weex/http/WXStreamModule.java b/android/sdk/src/main/java/com/taobao/weex/http/WXStreamModule.java
index d58f30ef6d..51369174b8 100644
--- a/android/sdk/src/main/java/com/taobao/weex/http/WXStreamModule.java
+++ b/android/sdk/src/main/java/com/taobao/weex/http/WXStreamModule.java
@@ -324,8 +324,12 @@ public void onHeadersReceived(int statusCode,Map<String,List<String>> headers) {
         Iterator<Map.Entry<String, List<String>>> it = headers.entrySet().iterator();
         while (it.hasNext()) {
           Map.Entry<String, List<String>> entry = it.next();
-          if (entry.getValue().size() > 0) {
+          if (entry.getValue().size() == 0) {
+            continue;
+          } else if (entry.getValue().size() == 1)
             simpleHeaders.put(entry.getKey() == null ? "_" : entry.getKey(), entry.getValue().get(0));
+          else {
+            simpleHeaders.put(entry.getKey() == null ? "_" : entry.getKey(), entry.getValue().toString());
           }
         }
       }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services