mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 22:45:05 +00:00
Fixed crash in activitypub_request() when there is no payload.
This commit is contained in:
parent
230a548767
commit
b846c943b3
1 changed files with 8 additions and 2 deletions
|
@ -95,8 +95,14 @@ int activitypub_request(snac *snac, const char *url, xs_dict **data)
|
|||
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);
|
||||
xs_str_in(ctype, "application/ld+json") != -1) {
|
||||
|
||||
/* if there is no payload, fail */
|
||||
if (xs_is_null(payload))
|
||||
status = 400;
|
||||
else
|
||||
*data = xs_json_loads(payload);
|
||||
}
|
||||
else
|
||||
status = 500;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue