Skip to content

Commit 01a41f4

Browse files
committed
2 parents 5406e90 + 40ac9bc commit 01a41f4

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

NewLife.Remoting/ApiClient.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,17 @@ public virtual Int32 InvokeOneWay(String action, Object? args = null, Byte flag
324324
// Headers 注入
325325
if (Headers.Count > 0 && args != null)
326326
{
327-
var dic = args.ToDictionary();
328-
foreach (var item in Headers)
327+
var type = args.GetType();
328+
// 数组/列表类型不转换为字典,避免丢失原始数据
329+
if (!type.IsArray && !typeof(System.Collections.IList).IsAssignableFrom(type))
329330
{
330-
if (!dic.ContainsKey(item.Key)) dic[item.Key] = item.Value;
331+
var dic = args.ToDictionary();
332+
foreach (var item in Headers)
333+
{
334+
if (!dic.ContainsKey(item.Key)) dic[item.Key] = item.Value;
335+
}
336+
args = dic;
331337
}
332-
args = dic;
333338
}
334339

335340
// 埋点,注入traceParent到参数集合

0 commit comments

Comments
 (0)