Skip to content

fix(go): return 404 for missing modules#196

Open
ychampion wants to merge 1 commit into
git-pkgs:mainfrom
ychampion:fix-go-proxy-not-found-status
Open

fix(go): return 404 for missing modules#196
ychampion wants to merge 1 commit into
git-pkgs:mainfrom
ychampion:fix-go-proxy-not-found-status

Conversation

@ychampion

Copy link
Copy Markdown

Summary

  • return HTTP 404 when the upstream Go module mirror reports a missing artifact
  • keep other upstream failures at 502 and cover both status paths

Why

Go only advances from GOPROXY=<proxy>,direct when the proxy responds with 404 or 410. The handler was turning the upstream not-found sentinel into 502, which prevented the documented fallback. Fixes #184.

Validation

  • go test -race ./...
  • go build ./...
  • go tool golangci-lint run ./...
  • go vet ./...

Constraint: GOPROXY advances to direct only after 404 or 410 responses
Confidence: high
Scope-risk: narrow
Tested: go test -race ./...; go build ./...; go tool golangci-lint run ./...; go vet ./...
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.

Go: should respond with 404 when artifact not found

1 participant