core: Need to be able to parse the app path more differently.

This commit is contained in:
2025-12-06 14:26:07 -05:00
parent d84b06f814
commit 6381ba6785
2 changed files with 29 additions and 2 deletions

View File

@@ -253,7 +253,26 @@ typedef struct _app_hello_t
static void _httpd_app_hello_work(tf_ssb_t* ssb, void* user_data)
{
app_hello_t* work = user_data;
tf_printf("%s\n", work->path);
char blob_id[k_id_base64_len] = { 0 };
tf_httpd_user_app_t* user_app = tf_httpd_parse_user_app_from_path(work->path, NULL);
tf_printf("path = %s\n", work->path);
if (user_app)
{
tf_printf("user = %s app = %s\n", user_app->user, user_app->app);
size_t length = strlen("path:") + strlen(user_app->app) + 1;
char* key = alloca(length);
snprintf(key, length, "path:%s", user_app->app);
const char* value = tf_ssb_db_get_property(ssb, user_app->user, key);
tf_string_set(blob_id, sizeof(blob_id), value);
tf_free((void*)value);
}
else if (work->path[0] == '/' && (work->path[1] == '%' || work->path[1] == '&') && strlen(work->path) >= 1 + k_blob_id_len && strstr(work->path, ".sha256"))
{
memcpy(blob_id, work->path + 1, strstr(work->path, ".sha256") - work->path - 1 + strlen(".sha256"));
}
tf_printf("BLOB ID=%s\n", blob_id);
tf_free(user_app);
}
static void _httpd_app_hello_after_work(tf_ssb_t* ssb, int status, void* user_data)