diff --git a/core/parse/parse.go b/core/parse/parse.go index c570f9b..8ae3f0c 100644 --- a/core/parse/parse.go +++ b/core/parse/parse.go @@ -74,6 +74,9 @@ func Decode(data []byte, body *model.Body) error { if idx == -1 { idx = strings.LastIndex(name, "\x00") } + if idx == -1 { + idx = strings.LastIndex(name, "\xe2") + } if idx > 0 { name = name[idx+1:] @@ -87,11 +90,13 @@ func Decode(data []byte, body *model.Body) error { // 解析data KEY body.Data = make(map[string]string) for i := 1; i < len(multi); i++ { - m := strings.Split(multi[i], "=") - if len(m) != 2 { - return errors.New("invalid msg body") + str := multi[i] + idx := strings.Index(str, "=") + if idx > 0 { + key := str[:idx] + value := str[idx+1:] + body.Data[key] = value } - body.Data[m[0]] = m[1] } return nil