maxapi: always merge params into the payload for signing

This commit is contained in:
c9s 2022-04-20 12:16:34 +08:00
parent 4d8997a8d5
commit ff7f1a8bc8

View File

@ -245,14 +245,12 @@ func (c *RestClient) newAuthenticatedRequest(ctx context.Context, m string, refU
}
}
if m == "GET" {
for k, vs := range params {
k = strings.TrimSuffix(k, "[]")
if len(vs) == 1 {
payload[k] = vs[0]
} else {
payload[k] = vs
}
for k, vs := range params {
k = strings.TrimSuffix(k, "[]")
if len(vs) == 1 {
payload[k] = vs[0]
} else {
payload[k] = vs
}
}