fix(deb): normalize apt flat-repo ./ dist prefix in github_deb serve
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

The metadata-only github_deb flat repo has the same defect as the local repo:
real apt requests <repo>/./Packages (and ./Release), which ServeRemote matched
literally and 404d. Reuse deb.go normalizeIndexPath to collapse the dot-segment
before matching the synthesized index.
This commit is contained in:
unkin-agent
2026-08-11 22:41:55 +10:00
committed by unkin-agent
parent b2a6be8eb5
commit fd4fb160df
2 changed files with 47 additions and 1 deletions
+5 -1
View File
@@ -131,9 +131,13 @@ func (p *GitHubProvider) AuthHeaders(ctx context.Context, remote models.Remote)
// (Packages/Packages.gz/Release), 404s the signed index variants (the repo is
// consumed via [trusted=yes]), and 302-redirects .deb downloads to the backend
// releases_remote. Returns false only for paths it does not own.
func (p *GitHubProvider) ServeRemote(w http.ResponseWriter, r *http.Request, remote models.Remote, path, proxyBaseURL string, store provider.RemoteMetadataStore) bool {
func (p *GitHubProvider) ServeRemote(w http.ResponseWriter, r *http.Request, remote models.Remote, reqPath, proxyBaseURL string, store provider.RemoteMetadataStore) bool {
p.onRequest(remote, store)
// apt appends the flat-repo dist "./" verbatim, so it asks for "./Packages"
// etc.; collapse the dot-segment before matching the synthesized index.
path := normalizeIndexPath(reqPath)
switch path {
case "Packages", "Packages.gz", "Release":
p.serveIndex(w, r, remote, path, store)