feat: handle empty response from webhook endpoint

This commit is contained in:
Lakhan Samani 2022-07-17 16:25:16 +05:30
parent 41468b5b60
commit 70ea463f60

View File

@ -97,9 +97,11 @@ func TestEndpointResolver(ctx context.Context, params model.TestEndpointRequest)
}
response := map[string]interface{}{}
if err := json.Unmarshal(body, &response); err != nil {
log.Debug("error un-marshalling response: ", err)
return nil, err
if string(body) != "" {
if err := json.Unmarshal(body, &response); err != nil {
log.Debug("error un-marshalling response: ", err)
return nil, err
}
}
statusCode := int64(resp.StatusCode)