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

alexstocks pushed a commit to branch 1.5
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/1.5 by this push:
     new 699e0e2  bugfix: Give it an initial value when attachments is nil
     new a773c5f  Merge pull request #1087 from rockXiaofeng/Ftr/nilAttachments
699e0e2 is described below

commit 699e0e2e59ef7ecf55d8d84b804959c6f632de4f
Author: WangXiaofeng <[email protected]>
AuthorDate: Tue Mar 16 09:53:51 2021 +0800

    bugfix: Give it an initial value when attachments is nil
---
 protocol/dubbo/impl/hessian.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/protocol/dubbo/impl/hessian.go b/protocol/dubbo/impl/hessian.go
index e355276..4aaf67b 100644
--- a/protocol/dubbo/impl/hessian.go
+++ b/protocol/dubbo/impl/hessian.go
@@ -254,6 +254,10 @@ func unmarshalRequestBody(body []byte, p *DubboPackage) 
error {
                return perrors.WithStack(err)
        }
 
+       if attachments == nil {
+               attachments = 
map[interface{}]interface{}{constant.INTERFACE_KEY: target}
+       }
+
        if v, ok := attachments.(map[interface{}]interface{}); ok {
                v[DUBBO_VERSION_KEY] = dubboVersion
                req[6] = ToMapStringInterface(v)

Reply via email to