Skip to content
Open
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
12 changes: 12 additions & 0 deletions pkg/components/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,18 @@ func (e *HTTP) executeRequest(httpCtx core.HTTPContext, spec Spec, timeout time.
return nil, err
}

// Read the entire response body before returning, because the deferred
// cancel() will cancel the request context and abort any in-flight reads.
// We replace resp.Body with the buffered content so callers (processResponse)
// can read it without hitting "context canceled" errors.
// See: https://github.com/superplanehq/superplane/issues/3141
bodyBytes, err := io.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
return nil, fmt.Errorf("failed to read response body: %w", err)
}
resp.Body = io.NopCloser(bytes.NewReader(bodyBytes))

return resp, nil
}

Expand Down