Improve error handling on join failure.
Solves the issue of groups with a name ending in "/".
This commit is contained in:
1 parent
e3098899e1
commit
b134bfcf13
4 files changed
+74
-46
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user