From 980ce11c0aae8ab0b10e9a97e88e6c602cea8dea Mon Sep 17 00:00:00 2001 From: Priyanshubhartistm Date: Sat, 9 May 2026 02:19:55 +0530 Subject: [PATCH] fix typo in DownloadArtifact: was reading req.Body instead of resp.Body MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After httpClient.Do(req) returns, req.Body is already consumed — so io.ReadAll(req.Body) always gives back empty bytes. Swapped it to resp.Body so we actually get the server's response back. Also fixed the two log labels that still said "uploading artifact" inside the download path (copy-paste leftover from UploadArtifact). Signed-off-by: Priyanshubhartistm --- pkg/connectors/microcks_client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/connectors/microcks_client.go b/pkg/connectors/microcks_client.go index 4a8d16b..0bca7b2 100644 --- a/pkg/connectors/microcks_client.go +++ b/pkg/connectors/microcks_client.go @@ -510,7 +510,7 @@ func (c *microcksClient) DownloadArtifact(artifactURL string, mainArtifact bool, req.Header.Set("Authorization", "Bearer "+c.AuthToken) // Dump request if verbose required. - config.DumpRequestIfRequired("Microcks for uploading artifact", req, true) + config.DumpRequestIfRequired("Microcks for downloading artifact", req, true) resp, err := c.httpClient.Do(req) if err != nil { @@ -519,9 +519,9 @@ func (c *microcksClient) DownloadArtifact(artifactURL string, mainArtifact bool, defer resp.Body.Close() // Dump response if verbose required. - config.DumpResponseIfRequired("Microcks for uploading artifact", resp, true) + config.DumpResponseIfRequired("Microcks for downloading artifact", resp, true) - respBody, err := io.ReadAll(req.Body) + respBody, err := io.ReadAll(resp.Body) if err != nil { panic(err.Error()) }