Skip to content

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

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

source/http: report errors before checksum mismatch#7113
Karthik-Chowdary wants to merge 1 commit 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:

  • mise x go@1.26.3 -- go test ./source/http -run ^'TestHTTPChecksumReturnsResponseStatus$' -count=1\n- git diff --check\n\nBoth pass. The full package suite was also run; the new test passes, while four existing snapshot-reading tests fail because this unprivileged environment cannot perform bind mounts (operation not permitted).\n\nFixes Dockerfile frontend: ADD --checksum=.. https://.. hides HTTP error #6380

@AkihiroSuda

Copy link
Copy Markdown
Member

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 <21139050+Karthik-Chowdary@users.noreply.github.com>
@Karthik-Chowdary
Karthik-Chowdary force-pushed the fix/http-checksum-status-6380 branch from 57301d0 to 03e028e Compare September 7, 2026 06:39
@Karthik-Chowdary

Copy link
Copy Markdown
Author

Removed the merge commit by rebasing onto current master; the PR is again a single logical commit at 03e028e79. Verified go test ./source/http passes under Go 1.26.3 in a container with the mount capability required by these snapshot tests. The fork-workflow runs now await maintainer approval.

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