Refuse a PRIVMSG or NOTICE whose body or meta has the wrong type (closes #245) #247

Merged
clawbot merged 1 commits from issue-245-check-body into next 2026-11-02 07:39:18 +01:00
1 Commits
Author SHA1 Message Date
clawbot f3b0970129 Refuse a PRIVMSG or NOTICE whose body or meta has the wrong type (closes #245)
check / check (push) Canceled after 0s
Over the HTTP API, a PRIVMSG or NOTICE body was checked only by
decoding it into a list of strings. JSON null decodes into an empty
string there, and meta was not checked at all, so a null line, or a
meta that is not an object, reached every recipient.

handlePrivmsg now answers 400 invalid request body, before anything
else, when body is present and is not an array of strings, or meta is
present and is not an object. The check returns the lines it accepted,
and the empty-body check counts those, so body is decoded once. A
missing or empty body still gets ERR_NOTEXTTOSEND. README.md says so.

Model: opus-5-5
2026-11-02 06:14:22 +00:00