Skip to content

Commit be3a67e

Browse files
authored
bugfix(http): add response body to response struct
2 parents 424e1f4 + be7b0d6 commit be3a67e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/http/manager.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,20 @@ func (h *HTTPManager) ExecuteRequest(req *Request) (*Response, error) {
100100
}
101101
}()
102102

103+
// Read response body
104+
responseBody, err := io.ReadAll(resp.Body)
105+
if err != nil {
106+
log.Error("failed to read response body", "error", err)
107+
return nil, fmt.Errorf("failed to read response body: %w", err)
108+
}
109+
103110
duration := time.Since(start)
104111

105112
response := &Response{
106113
StatusCode: resp.StatusCode,
107114
Status: resp.Status,
108115
Headers: resp.Header,
116+
Body: string(responseBody),
109117
Duration: duration,
110118
}
111119

0 commit comments

Comments
 (0)