diff options
-rw-r--r-- | system/api/handlers.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/system/api/handlers.go b/system/api/handlers.go index d1758f0..afe5819 100644 --- a/system/api/handlers.go +++ b/system/api/handlers.go @@ -92,6 +92,11 @@ func postHandler(res http.ResponseWriter, req *http.Request) { id := q.Get("id") t := q.Get("type") + if _, ok := content.Types[t]; !ok { + res.WriteHeader(http.StatusNotFound) + return + } + if t == "" || id == "" { res.WriteHeader(http.StatusBadRequest) return |