diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-12 22:59:56 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-12 22:59:56 +0800 |
commit | ac8df1ce8c48547a9c73dd51461f7212585962c2 (patch) | |
tree | d8faf736033596777ffba7c43ecb5142ab290a5b /router_http.go | |
parent | {ssh,global}.go, index.html: Add global data containing ssh fp (diff) | |
download | forge-ac8df1ce8c48547a9c73dd51461f7212585962c2.tar.gz forge-ac8df1ce8c48547a9c73dd51461f7212585962c2.tar.zst forge-ac8df1ce8c48547a9c73dd51461f7212585962c2.zip |
router_http: Ensure module index has /
Diffstat (limited to '')
-rw-r--r-- | router_http.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/router_http.go b/router_http.go index 9b42e9b..fbf729b 100644 --- a/router_http.go +++ b/router_http.go @@ -57,6 +57,10 @@ func (router *http_router_t) ServeHTTP(w http.ResponseWriter, r *http.Request) { case non_empty_last_segments_len == separator_index+1: http.Error(w, "Group root hasn't been implemented yet", http.StatusNotImplemented) case non_empty_last_segments_len == separator_index+2: + if !dir_mode { + http.Redirect(w, r, r.URL.Path+"/", http.StatusSeeOther) + return + } module_type := segments[separator_index+1] params["group_name"] = segments[0] switch module_type { |