From 6f10e05c325ff523da45e777cdd6801a4f628e68 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 2 Jul 2022 19:58:43 +0200 Subject: [PATCH] Fix FolderServeNode. --- .../folder_serve_nodes/browsable_folder_serve_node.cpp | 4 ++-- .../folder_serve_nodes/browsable_folder_serve_node.h | 2 +- .../web/nodes/folder_serve_nodes/folder_serve_node.cpp | 10 +++------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/modules/web/nodes/folder_serve_nodes/browsable_folder_serve_node.cpp b/modules/web/nodes/folder_serve_nodes/browsable_folder_serve_node.cpp index 5884f2a1e..49258407a 100644 --- a/modules/web/nodes/folder_serve_nodes/browsable_folder_serve_node.cpp +++ b/modules/web/nodes/folder_serve_nodes/browsable_folder_serve_node.cpp @@ -17,7 +17,7 @@ void BrowsableFolderServeNode::set_should_render_menu(const bool &val) { _should_render_menu = val; } -void BrowsableFolderServeNode::_handle_request_main(Ref request) { +void BrowsableFolderServeNode::_handle_request(Ref request) { String file_name = request->get_path(true, false); String *s = _folder_indexes[file_name]; @@ -28,7 +28,7 @@ void BrowsableFolderServeNode::_handle_request_main(Ref reques } if (_should_render_menu) { - render_menu(request); + render_main_menu(request); } request->body += (*s); diff --git a/modules/web/nodes/folder_serve_nodes/browsable_folder_serve_node.h b/modules/web/nodes/folder_serve_nodes/browsable_folder_serve_node.h index 5d5da7c8e..3e047e4fb 100644 --- a/modules/web/nodes/folder_serve_nodes/browsable_folder_serve_node.h +++ b/modules/web/nodes/folder_serve_nodes/browsable_folder_serve_node.h @@ -27,7 +27,7 @@ public: bool get_should_render_menu(); void set_should_render_menu(const bool &val); - void _handle_request_main(Ref request); + void _handle_request(Ref request); void render_index(Ref request); void render_preview(Ref request); diff --git a/modules/web/nodes/folder_serve_nodes/folder_serve_node.cpp b/modules/web/nodes/folder_serve_nodes/folder_serve_node.cpp index eb0696fbd..0b77bdd49 100644 --- a/modules/web/nodes/folder_serve_nodes/folder_serve_node.cpp +++ b/modules/web/nodes/folder_serve_nodes/folder_serve_node.cpp @@ -22,7 +22,7 @@ void FolderServeNode::_handle_request_main(Ref request) { if (rp == "") { if (!try_route_request_to_children(request)) { - _handle_request_main(request); + handle_request(request); } return; } @@ -33,16 +33,12 @@ void FolderServeNode::_handle_request_main(Ref request) { int file_indx = _file_cache->wwwroot_get_file_index(file_name); if (file_indx != -1) { - String fp = _file_cache->get_wwwroot_abs(); - fp = fp.append_path(file_name); - - request->send_file(_file_cache->wwwroot_get_file_orig_path(file_indx)); - + request->send_file(_file_cache->wwwroot_get_file_orig_path_abs(file_indx)); return; } if (!try_route_request_to_children(request)) { - _handle_request_main(request); + handle_request(request); } }