Skip to content

fix: read response body in DownloadArtifact#259

Merged
lbroudoux merged 1 commit intomicrocks:masterfrom
mugiwaraluffy56:fix/download-artifact-response-body
May 4, 2026
Merged

fix: read response body in DownloadArtifact#259
lbroudoux merged 1 commit intomicrocks:masterfrom
mugiwaraluffy56:fix/download-artifact-response-body

Conversation

@mugiwaraluffy56
Copy link
Copy Markdown
Contributor

DownloadArtifact was reading from req.Body after the request completed instead of reading resp.Body. That means the CLI returned the multipart request payload, or an empty body, instead of the Microcks API response/error message from /artifact/download.

This PR changes DownloadArtifact to read resp.Body and adds an httptest coverage case that verifies the returned message comes from the server response.

Verification:

  • go test ./pkg/connectors

Note: go test ./... still fails on the existing cmd/context_test.go setup because ./testdata/local.config cannot be created when cmd/testdata is absent. That failure is unrelated to this change.

Signed-off-by: puneeth_aditya_5656 <myakampuneeth@gmail.com>
@Vaishnav88sk
Copy link
Copy Markdown

If this fixes an existing issue, please add Fixes #xxx so it auto-closes. If not, it’s good practice to create an issue before opening a PR.

@mugiwaraluffy56
Copy link
Copy Markdown
Contributor Author

If this fixes an existing issue, please add Fixes #xxx so it auto-closes. If not, it’s good practice to create an issue before opening a PR.

sorry for the mistake, will definitely follow that from now on : )

Copy link
Copy Markdown
Member

@lbroudoux lbroudoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very nice catch! Thanks again!

@lbroudoux lbroudoux added this to the Next milestone May 4, 2026
@lbroudoux lbroudoux added kind/enhancement New feature or request component/connectors go Pull requests that update go code labels May 4, 2026
@lbroudoux lbroudoux merged commit f2fcb31 into microcks:master May 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/connectors go Pull requests that update go code kind/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants