fix: strip /github prefix in auth proxy github case
Build and Push to GHCR / build-and-push (push) Has been cancelled

The public /github/ route uses http.StripPrefix to remove /github
before forwarding to githubProxy. The auth proxy's github case was
missing this strip, causing /arkylin to be forwarded as
/github/arkylin → 404 on GitHub.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
This commit is contained in:
Agent
2026-05-25 00:08:03 +08:00
co-authored by HAPI
parent fc9e336e6b
commit 82ba0ff2d5
+1 -4
View File
@@ -178,10 +178,7 @@ func buildHandler(cfg *config.Config) (*admin.Handler, http.Handler) {
} }
ghcrProxy.ServeHTTP(w, r) ghcrProxy.ServeHTTP(w, r)
case "github": case "github":
if !strings.HasPrefix(r.URL.Path, "/github/") { middleware.StripPrefix("/github", githubProxy).ServeHTTP(w, r)
r.URL.Path = "/github" + r.URL.Path
}
githubProxy.ServeHTTP(w, r)
default: default:
dockerProxy.ServeHTTP(w, r) dockerProxy.ServeHTTP(w, r)
} }