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

[incubator-weex] branch master updated: [WEEX-482][Android] Added support for multi-value headers(WXStreamModule) (#1300)

This is an automated email from the ASF dual-hosted git repository.

kyork pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new c7dd6c7  [WEEX-482][Android] Added support for multi-value headers(WXStreamModule) (#1300)
c7dd6c7 is described below

commit c7dd6c76fe726a4413b08d3c895c91d521d01755
Author: anotherjsguy <ku...@gmail.com>
AuthorDate: Mon Jan 7 08:49:18 2019 +0530

    [WEEX-482][Android] Added support for multi-value headers(WXStreamModule) (#1300)
    
    * added handling for multi value headers
---
 android/sdk/src/main/java/com/taobao/weex/http/WXStreamModule.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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 d796d14..12a145b 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
@@ -337,8 +337,12 @@ public class WXStreamModule extends WXModule {
         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());
           }
         }
       }