aboutsummaryrefslogtreecommitdiff
path: root/http_server.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-15 10:23:08 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-15 10:23:08 +0800
commit3aae548374b0ca19b9e14c30a1ca6790251cc1db (patch)
treeef6b63bf7e8ed959a665213683d44e08287d30f5 /http_server.go
parent{http_server,url}.go: Fix redirects (diff)
downloadforge-3aae548374b0ca19b9e14c30a1ca6790251cc1db.tar.gz
forge-3aae548374b0ca19b9e14c30a1ca6790251cc1db.tar.zst
forge-3aae548374b0ca19b9e14c30a1ca6790251cc1db.zip
*.go: Reformat
Diffstat (limited to 'http_server.go')
-rw-r--r--http_server.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/http_server.go b/http_server.go
index e830fb1..ffbb711 100644
--- a/http_server.go
+++ b/http_server.go
@@ -122,9 +122,9 @@ func (router *http_router_t) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
// TODO: subgroups
if non_empty_last_segments_len == separator_index+3 {
- if redirect_with_slash(w, r) {
- return
- }
+ if redirect_with_slash(w, r) {
+ return
+ }
handle_repo_index(w, r, params)
return
}
@@ -135,7 +135,7 @@ func (router *http_router_t) ServeHTTP(w http.ResponseWriter, r *http.Request) {
case "tree":
params["rest"] = strings.Join(segments[separator_index+4:], "/")
if len(segments) < separator_index+5 && redirect_with_slash(w, r) {
- return
+ return
}
handle_repo_tree(w, r, params)
case "raw":