Commit d440cdf8 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Don't redirect inexistent groups.

parent 869eb9b8
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment