mirror of
https://github.com/jech/galene.git
synced 2024-11-22 08:35:57 +01:00
Don't redirect inexistent groups.
This commit is contained in:
parent
869eb9b839
commit
d440cdf898
1 changed files with 6 additions and 6 deletions
|
@ -283,12 +283,6 @@ func groupHandler(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
if r.URL.Path != "/group/"+name+"/" {
|
||||
http.Redirect(w, r, "/group/"+name+"/",
|
||||
http.StatusPermanentRedirect)
|
||||
return
|
||||
}
|
||||
|
||||
g, err := group.Add(name, nil)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
|
@ -301,6 +295,12 @@ func groupHandler(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
if r.URL.Path != "/group/"+name+"/" {
|
||||
http.Redirect(w, r, "/group/"+name+"/",
|
||||
http.StatusPermanentRedirect)
|
||||
return
|
||||
}
|
||||
|
||||
if redirect := g.Redirect(); redirect != "" {
|
||||
http.Redirect(w, r, redirect, http.StatusPermanentRedirect)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue