ssb: Indicate which muxrpc sends failed, and use that to fix some replication nonsense and log noise.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 15m22s

This commit is contained in:
2024-10-23 14:13:55 -04:00
parent 4118323631
commit 86751362cb
5 changed files with 55 additions and 40 deletions

View File

@ -982,12 +982,7 @@ static bool _is_filename_safe(const char* filename)
}
for (const char* p = filename; *p; p++)
{
if ((*p <= 'a' && *p >= 'z') &&
(*p <= 'A' && *p >= 'Z') &&
(*p <= '0' && *p >= '9') &&
*p != '.' &&
*p != '-' &&
*p != '_')
if ((*p <= 'a' && *p >= 'z') && (*p <= 'A' && *p >= 'Z') && (*p <= '0' && *p >= '9') && *p != '.' && *p != '-' && *p != '_')
{
return false;
}
@ -1049,9 +1044,12 @@ static void _httpd_endpoint_view_after_work(tf_ssb_t* ssb, int status, void* use
snprintf(content_disposition, sizeof(content_disposition), "attachment; filename=%s", filename);
}
const char* headers[] = {
"Content-Security-Policy", "sandbox allow-downloads allow-top-navigation-by-user-activation",
"Content-Type", view->data ? _httpd_mime_type_from_magic_bytes_internal(view->data, view->size) : "text/plain",
filename ? "Content-Disposition" : NULL, filename ? content_disposition : NULL,
"Content-Security-Policy",
"sandbox allow-downloads allow-top-navigation-by-user-activation",
"Content-Type",
view->data ? _httpd_mime_type_from_magic_bytes_internal(view->data, view->size) : "text/plain",
filename ? "Content-Disposition" : NULL,
filename ? content_disposition : NULL,
};
int count = filename ? tf_countof(headers) / 2 : (tf_countof(headers) / 2 - 1);
if (view->not_modified)