fix(deb): normalize apt flat-repo ./ dist prefix in github_deb serve
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user