Skip to content

fix typo in DownloadArtifact: was reading req.Body instead of resp.Body#338

Open
Priyanshubhartistm wants to merge 1 commit into
microcks:masterfrom
Priyanshubhartistm:fix/downloadartifact-resp-body-read
Open

fix typo in DownloadArtifact: was reading req.Body instead of resp.Body#338
Priyanshubhartistm wants to merge 1 commit into
microcks:masterfrom
Priyanshubhartistm:fix/downloadartifact-resp-body-read

Conversation

@Priyanshubhartistm
Copy link
Copy Markdown

@Priyanshubhartistm Priyanshubhartistm commented May 8, 2026

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).

Description

  • DownloadArtifact was calling io.ReadAll(req.Body) instead of io.ReadAll(resp.Body), meaning the server response was always silently discarded
  • On a 201 the CLI printed Microcks has discovered '' (empty string - service name was never captured)
  • On any non-201 the error message was blank, so CI would fail with Got error when invoking Microcks client importing Artifact: and no further detail
  • Fixed the two DumpRequestIfRequired / DumpResponseIfRequired log labels in DownloadArtifact that still said "uploading artifact" (copy-pasted from UploadArtifact and never updated)

Related issue(s)

Fixes #337

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 <bhartipriyanshustm@gmail.com>
@Priyanshubhartistm
Copy link
Copy Markdown
Author

Hi @Harsh4902, @lbroudoux

Could you please review this PR when you get a chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: DownloadArtifact reads from req.Body instead of resp.Body

1 participant