mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-14 17:45:04 +00:00
Defend from kbin.social messages not having a content-type header.
This commit is contained in:
parent
42803e2116
commit
96b8791754
1 changed files with 3 additions and 0 deletions
|
@ -90,6 +90,9 @@ int activitypub_request(snac *snac, const char *url, xs_dict **data)
|
|||
/* ensure it's ActivityPub data */
|
||||
ctype = xs_dict_get(response, "content-type");
|
||||
|
||||
if (xs_is_null(ctype))
|
||||
status = 400;
|
||||
else
|
||||
if (xs_str_in(ctype, "application/activity+json") != -1 ||
|
||||
xs_str_in(ctype, "application/ld+json") != -1)
|
||||
*data = xs_json_loads(payload);
|
||||
|
|
Loading…
Reference in a new issue