Use right URL when fetching Forgejo user data for audit.

This commit is contained in:
Catherine
2026-03-08 00:16:13 +00:00
parent 52fa8d1462
commit 559f0c6ae8

View File

@@ -610,7 +610,9 @@ func checkGogsRepositoryPushPermission(baseURL *url.URL, authorization string) e
// Gogs, Gitea, and Forgejo all support the same API here.
func fetchGogsAuthorizedUser(baseURL *url.URL, authorization string) (*ForgeUser, error) {
request, err := http.NewRequest("GET", baseURL.JoinPath("/api/v1/user").String(), nil)
request, err := http.NewRequest("GET", baseURL.ResolveReference(&url.URL{
Path: "/api/v1/user",
}).String(), nil)
if err != nil {
panic(err) // misconfiguration
}