diff --git a/protocol/json/server_request.go b/protocol/json/server_request.go index 0e1b593..ba90f3e 100644 --- a/protocol/json/server_request.go +++ b/protocol/json/server_request.go @@ -148,16 +148,21 @@ func (src *ServerRequestCodec) Params() ([]string, error) { var results []string for _, v := range values { - b, err := json.Marshal(v) - if nil != err { - src.err = &Error{ - Code: E_INVALID_REQ, - Message: err.Error(), - Data: src.req.Params, + switch v := v.(type) { + case string: + results = append(results, v) + default: + b, err := json.Marshal(v) + if nil != err { + src.err = &Error{ + Code: E_INVALID_REQ, + Message: err.Error(), + Data: src.req.Params, + } + return nil, src.err } - return nil, src.err + results = append(results, string(b)) } - results = append(results, string(b)) } return results, nil