mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-03-06 11:38:19 +00:00
Categories: Ignore empty hypha names and cat names in requests
This commit is contained in:
parent
3025aab445
commit
0446fc4794
@ -47,6 +47,10 @@ func handlerRemoveFromCategory(w http.ResponseWriter, rq *http.Request) {
|
|||||||
_, _ = io.WriteString(w, "403 Forbidden")
|
_, _ = io.WriteString(w, "403 Forbidden")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if hyphaName == "" || catName == "" {
|
||||||
|
http.Redirect(w, rq, redirectTo, http.StatusSeeOther)
|
||||||
|
return
|
||||||
|
}
|
||||||
categories.RemoveHyphaFromCategory(hyphaName, catName)
|
categories.RemoveHyphaFromCategory(hyphaName, catName)
|
||||||
http.Redirect(w, rq, redirectTo, http.StatusSeeOther)
|
http.Redirect(w, rq, redirectTo, http.StatusSeeOther)
|
||||||
}
|
}
|
||||||
@ -63,6 +67,10 @@ func handlerAddToCategory(w http.ResponseWriter, rq *http.Request) {
|
|||||||
_, _ = io.WriteString(w, "403 Forbidden")
|
_, _ = io.WriteString(w, "403 Forbidden")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if hyphaName == "" || catName == "" {
|
||||||
|
http.Redirect(w, rq, redirectTo, http.StatusSeeOther)
|
||||||
|
return
|
||||||
|
}
|
||||||
categories.AddHyphaToCategory(hyphaName, catName)
|
categories.AddHyphaToCategory(hyphaName, catName)
|
||||||
http.Redirect(w, rq, redirectTo, http.StatusSeeOther)
|
http.Redirect(w, rq, redirectTo, http.StatusSeeOther)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user