1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-05-29 09:55:35 +02:00

Do not allow empty messages

This commit is contained in:
Philipp Heckel 2021-11-18 14:21:00 -05:00
parent ae97fbe025
commit 8280e5b0ad
2 changed files with 6 additions and 0 deletions
server

View file

@ -243,6 +243,9 @@ func (s *Server) handlePublish(w http.ResponseWriter, r *http.Request, v *visito
return err
}
m := newDefaultMessage(t.id, string(b))
if m.Message == "" {
return errHTTPBadRequest
}
if err := t.Publish(m); err != nil {
return err
}