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

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


The following commit(s) were added to refs/heads/master by this push:
     new 5051b2b  [ISSUE #3025] fix http headers lose bug (#3029)
5051b2b is described below

commit 5051b2b9614163f77857fc02f26aff17c4166e0d
Author: dragon-zhang <[email protected]>
AuthorDate: Sun Mar 13 21:36:25 2022 +0800

    [ISSUE #3025] fix http headers lose bug (#3029)
---
 .../org/apache/shenyu/plugin/general/context/GeneralContextPlugin.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/shenyu-plugin/shenyu-plugin-general-context/src/main/java/org/apache/shenyu/plugin/general/context/GeneralContextPlugin.java
 
b/shenyu-plugin/shenyu-plugin-general-context/src/main/java/org/apache/shenyu/plugin/general/context/GeneralContextPlugin.java
index 7599336..4d28fe7 100644
--- 
a/shenyu-plugin/shenyu-plugin-general-context/src/main/java/org/apache/shenyu/plugin/general/context/GeneralContextPlugin.java
+++ 
b/shenyu-plugin/shenyu-plugin-general-context/src/main/java/org/apache/shenyu/plugin/general/context/GeneralContextPlugin.java
@@ -60,8 +60,9 @@ public class GeneralContextPlugin extends 
AbstractShenyuPlugin {
                         
generalContextMapWithRpcType.put(each.getGeneralContextKey(), 
each.getGeneralContextValue());
                         break;
                     case Constants.TRANSMIT_HEADER_TO_GENERAL_CONTEXT_TYPE:
+                        final List<String> header = 
headers.get(each.getGeneralContextKey());
                         
generalContextMapWithRpcType.put(StringUtils.isBlank(each.getGeneralContextValue())
 ? each.getGeneralContextKey() : each.getGeneralContextValue(),
-                                headers.getFirst(each.getGeneralContextKey()));
+                                CollectionUtils.isEmpty(header) ? null : 
String.join(", ", header));
                         break;
                     default:
                         break;

Reply via email to