init commit
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user