Skip to content

source/http: report errors before checksum mismatch - #7113

Open
Karthik-Chowdary wants to merge 2 commits into
moby:masterfrom
Karthik-Chowdary:fix/http-checksum-status-6380
Open

source/http: report errors before checksum mismatch#7113
Karthik-Chowdary wants to merge 2 commits into
moby:masterfrom
Karthik-Chowdary:fix/http-checksum-status-6380

Conversation

@Karthik-Chowdary

Copy link
Copy Markdown

Pinned HTTP sources download their payload during Snapshot. When the server returns an error response, the current path saves that response body and compares its digest first, producing a misleading checksum mismatch instead of the HTTP status reported by unpinned sources.

Check the response status before saving the snapshot. The regression test uses a local HTTP server returning 403 and verifies that Snapshot reports invalid response status 403.

Testing:

Pinned HTTP sources download their payload during Snapshot. Check the response status there before saving the error response as a snapshot and reporting its digest as a checksum mismatch.

Add a regression test proving a 403 response reports its status instead of a misleading digest mismatch.

Signed-off-by: Karthik Chowdary <[email protected]>
@AkihiroSuda

Copy link
Copy Markdown
Member

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants