Skip to content

fix: read response body in DownloadArtifact#259

Open
mugiwaraluffy56 wants to merge 1 commit intomicrocks:masterfrom
mugiwaraluffy56:fix/download-artifact-response-body
Open

fix: read response body in DownloadArtifact#259
mugiwaraluffy56 wants to merge 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>
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.

1 participant