Skip to content

Return 404 for non-allow-listed modules so go falls through - #2

Merged
lmb merged 1 commit into
mainfrom
fix-404-fallthrough
Jun 23, 2026
Merged

lmb merged 1 commit into
mainfrom
fix-404-fallthrough

Conversation

@lmb

@lmb lmb commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

The LFSFetcher returned a bare error for modules outside the allow-list, which goproxy renders as a 500. go treats 500 as fatal rather than falling through to the next GOPROXY entry, so transitive public dependencies of the served module failed to resolve.

Wrap fs.ErrNotExist via a shared lookup helper so unknown modules return 404 and go falls through to the public proxy, while genuine fetch errors still surface as 500. Add a test asserting the 404 status.

The LFSFetcher returned a bare error for modules outside the allow-list,
which goproxy renders as a 500. go treats 500 as fatal rather than
falling through to the next GOPROXY entry, so transitive public
dependencies of the served module failed to resolve.

Wrap fs.ErrNotExist via a shared lookup helper so unknown modules return
404 and go falls through to the public proxy, while genuine fetch errors
still surface as 500. Add a test asserting the 404 status.
@lmb
lmb enabled auto-merge (rebase) June 23, 2026 15:16
@lmb
lmb merged commit 13a3077 into main Jun 23, 2026
2 checks passed
@lmb
lmb deleted the fix-404-fallthrough branch June 23, 2026 15:17
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