fix: strip /github prefix in auth proxy github case
Build and Push to GHCR / build-and-push (push) Has been cancelled
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:
+1
-4
@@ -178,10 +178,7 @@ func buildHandler(cfg *config.Config) (*admin.Handler, http.Handler) {
|
||||
}
|
||||
ghcrProxy.ServeHTTP(w, r)
|
||||
case "github":
|
||||
if !strings.HasPrefix(r.URL.Path, "/github/") {
|
||||
r.URL.Path = "/github" + r.URL.Path
|
||||
}
|
||||
githubProxy.ServeHTTP(w, r)
|
||||
middleware.StripPrefix("/github", githubProxy).ServeHTTP(w, r)
|
||||
default:
|
||||
dockerProxy.ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user