init commit

This commit is contained in:
2026-05-07 10:27:16 +02:00
parent dea186c995
commit 9ad2672a66
36 changed files with 965 additions and 15 deletions
+3 -4
View File
@@ -71,12 +71,11 @@ func (h *GitHTTPHandler) ServeGit(w http.ResponseWriter, r *http.Request) {
}
// Build PATH_INFO: /{reponame}.git/{suffix}
// chi wildcard gives us everything after /{owner}/{repoGit}
suffix := chi.URLParam(r, "*")
// Strip the /{owner}/{repoGit} prefix from the raw URL path to get the suffix.
prefix := "/" + owner + "/" + repoGit
suffix := strings.TrimPrefix(r.URL.Path, prefix)
if suffix == "" {
suffix = "/"
} else if !strings.HasPrefix(suffix, "/") {
suffix = "/" + suffix
}
pathInfo := "/" + repoGit + suffix