Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion v2/pkg/engine/resolve/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ type ResponseInfo struct {
Request *http.Request
// ResponseHeaders contains a clone of the headers of the response from the subgraph.
ResponseHeaders http.Header
// ResponseBody contains the response body of the subgraph, it is of type string so that it cannot be manipulated.
ResponseBody string
}

func newResponseInfo(res *result, subgraphError error) *ResponseInfo {
responseInfo := &ResponseInfo{StatusCode: res.statusCode, Err: goerrors.Join(res.err, subgraphError)}
responseInfo := &ResponseInfo{
StatusCode: res.statusCode,
Err: goerrors.Join(res.err, subgraphError),
ResponseBody: res.out.String(),
}
if res.httpResponseContext != nil {
// We're using the response.Request here, because the body will be nil (since the response was read) and won't
// cause a memory leak.
Expand Down
Loading