mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-10 03:50:38 +03:00
Timeline pages are also served.
This commit is contained in:
parent
66a7f633b3
commit
94ef803701
@ -773,6 +773,12 @@ int activitypub_get_handler(d_char *req, char *q_path,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (xs_startswith(p_path, "p/")) {
|
if (xs_startswith(p_path, "p/")) {
|
||||||
|
xs *id = xs_fmt("%s/%s", snac.actor, p_path);
|
||||||
|
|
||||||
|
if ((msg = timeline_find(&snac, id)) != NULL)
|
||||||
|
msg = xs_dict_del(msg, "_snac");
|
||||||
|
else
|
||||||
|
status = 404;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
status = 404;
|
status = 404;
|
||||||
@ -782,6 +788,8 @@ int activitypub_get_handler(d_char *req, char *q_path,
|
|||||||
*b_size = strlen(*body);
|
*b_size = strlen(*body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snac_debug(&snac, 1, xs_fmt("activitypub_get_handler serving %s %d", q_path, status));
|
||||||
|
|
||||||
user_free(&snac);
|
user_free(&snac);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
@ -836,18 +844,18 @@ int activitypub_post_handler(d_char *req, char *q_path,
|
|||||||
xs *s1 = xs_sha256_base64(payload, p_size);
|
xs *s1 = xs_sha256_base64(payload, p_size);
|
||||||
xs *s2 = xs_fmt("SHA-256=%s", s1);
|
xs *s2 = xs_fmt("SHA-256=%s", s1);
|
||||||
|
|
||||||
if (strcmp(s2, v) == 0)
|
if (strcmp(s2, v) != 0) {
|
||||||
srv_log(xs_fmt("digest check OK"));
|
|
||||||
else
|
|
||||||
srv_log(xs_fmt("digest check FAILED"));
|
srv_log(xs_fmt("digest check FAILED"));
|
||||||
|
status = 400;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (valid_status(status)) {
|
||||||
enqueue_input(&snac, msg, req);
|
enqueue_input(&snac, msg, req);
|
||||||
|
*ctype = "application/activity+json";
|
||||||
|
}
|
||||||
|
|
||||||
user_free(&snac);
|
user_free(&snac);
|
||||||
|
|
||||||
if (valid_status(status))
|
|
||||||
*ctype = "application/activity+json";
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
2
httpd.c
2
httpd.c
@ -80,7 +80,7 @@ int server_get_handler(d_char *req, char *q_path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (status != 0)
|
if (status != 0)
|
||||||
srv_debug(1, xs_fmt("server_get_handler '%s' %d", q_path, status));
|
srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status));
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user