diff options
author | default <nobody@localhost> | 2023-12-18 13:24:07 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-12-18 13:24:07 +0100 |
commit | be3e5c96182974e569b58699aee18af71f86e13f (patch) | |
tree | 453bdbbf48628429dd76323fc24ef071209e6137 /activitypub.c | |
parent | 52f27123bbd6cf8101a86618c6aa04f52a07543a (diff) |
Added some crash checks.
Diffstat (limited to 'activitypub.c')
-rw-r--r-- | activitypub.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c index cfe3eea..6d017c6 100644 --- a/activitypub.c +++ b/activitypub.c @@ -2323,6 +2323,12 @@ int activitypub_post_handler(const xs_dict *req, const char *q_path, return 400; } + if (xs_is_null(payload)) { + *body = xs_str_new("no payload"); + *ctype = "text/plain"; + return 400; + } + if (xs_str_in(i_ctype, "application/activity+json") == -1 && xs_str_in(i_ctype, "application/ld+json") == -1) return 0; |