This commit is contained in:
crusader 2018-03-14 20:17:10 +09:00
parent dfb3b53775
commit 3b15bbd349

View File

@ -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