aboutsummaryrefslogtreecommitdiff
path: root/http_server.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-19 01:02:33 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-19 01:02:33 +0800
commit2d3e888321baeae889c7c51f2312aafba1ec70d0 (patch)
tree030c79f59ac2f62cce1567fd3fc07607b224d2fd /http_server.go
parenthttp: Consistently use redirect_with{out,}_slash, never r.URL.Path (diff)
downloadforge-2d3e888321baeae889c7c51f2312aafba1ec70d0.tar.gz
forge-2d3e888321baeae889c7c51f2312aafba1ec70d0.tar.zst
forge-2d3e888321baeae889c7c51f2312aafba1ec70d0.zip
contrib: Add contrib/MR index page
Diffstat (limited to 'http_server.go')
-rw-r--r--http_server.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/http_server.go b/http_server.go
index e5cb6ce..c17bc6f 100644
--- a/http_server.go
+++ b/http_server.go
@@ -146,7 +146,7 @@ func (router *http_router_t) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// TODO: subgroups
- params["repo"], params["repo_description"], err = open_git_repo(r.Context(), group_name, module_name)
+ params["repo"], params["repo_description"], params["repo_id"], err = open_git_repo(r.Context(), group_name, module_name)
if err != nil {
http.Error(w, "Error opening repo: "+err.Error(), http.StatusInternalServerError)
return
@@ -189,6 +189,11 @@ func (router *http_router_t) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
params["commit_id"] = segments[separator_index+4]
handle_repo_commit(w, r, params)
+ case "contrib":
+ if redirect_with_slash(w, r) {
+ return
+ }
+ handle_repo_contrib_index(w, r, params)
default:
http.Error(w, fmt.Sprintf("Unknown repo feature: %s", repo_feature), http.StatusNotFound)
}