Skip to content

fix: serve a moved tag when its archive matches the recorded hash - #86

Merged
traefiker merged 2 commits into
traefik:masterfrom
mmatur:fix/serve-tag-matching-recorded-hash
Oct 29, 2026
Merged

traefiker merged 2 commits into
traefik:masterfrom
mmatur:fix/serve-tag-matching-recorded-hash

Conversation

@mmatur

@mmatur mmatur commented Oct 28, 2026

Copy link
Copy Markdown
Member

Since #83, a moved tag is served from the commit the Go module proxy pinned at publication. For versions whose hash was recorded before that, the recorded hash is the one of the moved tag, which is what users load today. Serving the pinned commit breaks them: the bytes no longer match the hash, and for some versions the pinned code does not build with Yaegi, the tag was moved to fix that.

Now, when the tag moved and a hash is recorded, the tag archive is hashed. If it matches the recorded hash, the tag is served, otherwise the pinned commit. Only bytes that match a recorded hash are served, so a tag moved today still gets the pinned commit. New versions are not affected: their hash is recorded from the pinned commit.

The tag archive hash is cached by tag commit, so it costs one download per moved tag.

Comment thread pkg/handlers/module.go Resolved

@darkweaver87 darkweaver87 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, see my comments through

Comment thread pkg/handlers/pinned.go Resolved
Comment thread pkg/handlers/pinned.go Resolved
Comment thread pkg/handlers/pinned.go Resolved
Comment thread pkg/handlers/pinned.go Resolved
@traefiker
traefiker merged commit 6f15ae5 into traefik:master Oct 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug/fix a bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants