fix - agent.Struct fails to unmarshal response since 2.33.0 #2134 (#2137)

pull/2139/head
RW 2022-10-05 09:04:29 +02:00 committed by GitHub
parent e85a29abf3
commit 2a3ee9ca41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -826,6 +826,10 @@ func (a *Agent) Struct(v interface{}) (code int, body []byte, errs []error) {
return
}
if a.jsonDecoder == nil {
a.jsonDecoder = json.Unmarshal
}
if err := a.jsonDecoder(body, v); err != nil {
errs = append(errs, err)
}