From fbbdde07f6f36ea223a75bf50c0422011f6edb67 Mon Sep 17 00:00:00 2001 From: James Yao <39047217+JamesYaoh@users.noreply.github.com> Date: Wed, 11 Sep 2019 17:08:51 +0800 Subject: [PATCH] Update readwriter.go update Service.Interface to have default value Service.Path --- protocol/dubbo/readwriter.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/protocol/dubbo/readwriter.go b/protocol/dubbo/readwriter.go index 8c6c8a5a5..137f3d484 100644 --- a/protocol/dubbo/readwriter.go +++ b/protocol/dubbo/readwriter.go @@ -140,10 +140,14 @@ func (p *RpcServerPackageHandler) Read(ss getty.Session, data []byte) (interface if req[6] != nil { attachments = req[6].(map[interface{}]interface{}) } - pkg.Service.Interface = attachments[constant.INTERFACE_KEY].(string) if pkg.Service.Path == "" && attachments[constant.PATH_KEY] != nil { pkg.Service.Path = attachments[constant.PATH_KEY].(string) } + if _, ok := attachments[constant.INTERFACE_KEY]; ok { + pkg.Service.Interface = attachments[constant.INTERFACE_KEY].(string) + } else { + pkg.Service.Interface = pkg.Service.Path + } if attachments[constant.GROUP_KEY] != nil { pkg.Service.Group = attachments[constant.GROUP_KEY].(string) } -- GitLab