diff --git a/src/lander/lander_get.c b/src/lander/lander_get.c index d9b47c9..1cbc772 100644 --- a/src/lander/lander_get.c +++ b/src/lander/lander_get.c @@ -190,14 +190,19 @@ lnm_http_step_err lander_get_index(lnm_http_conn *conn) { lsm_str_len(entry_key) - prefix_len); break; case lander_entry_type_file: - ltm_instance_block_add_nested(&nested, c_ctx->instance, "file"); + case lander_entry_type_paste: + ltm_instance_block_add_nested(&nested, c_ctx->instance, + t == lander_entry_type_file ? "file" + : "paste"); ltm_instance_block_add_var( nested, "full_key", ltm_instance_block_type_buf, (void *)lsm_str_ptr(entry_key), lsm_str_len(entry_key)); + // Add the filename as the link name if known, or just the key otherwise lsm_str *filename; - if (lsm_entry_attr_get(&filename, handle, lander_attr_type_file_name)) { + if (lsm_entry_attr_get(&filename, handle, lander_attr_type_file_name) == + lsm_error_ok) { ltm_instance_block_add_var( nested, "filename", ltm_instance_block_type_buf, (void *)lsm_str_ptr(filename), lsm_str_len(filename)); diff --git a/src/main.c b/src/main.c index 351db58..c2dea68 100644 --- a/src/main.c +++ b/src/main.c @@ -25,7 +25,7 @@ const char *index_template = "\n" "
\n" "