Improve error handling on join failure.

Solves the issue of groups with a name ending in "/".
This commit is contained in:
Juliusz Chroboczek committed 2020-12-04 22:56:29 +01:00
1 parent e3098899e1
commit b134bfcf13
4 files changed
+74 -46

No files matched your search

+6
View File
@@ -243,6 +243,12 @@ func groupHandler(w http.ResponseWriter, r *http.Request) {
return
}
if strings.HasSuffix(r.URL.Path, "/") {
http.Redirect(w, r, r.URL.Path[:len(r.URL.Path)-1],
http.StatusPermanentRedirect)
return
}
g, err := group.Add(name, nil)
if err != nil {
if os.IsNotExist(err) {