diff --git a/modules/web/http/web_node.cpp b/modules/web/http/web_node.cpp index ecdc11102..acb65bd3a 100644 --- a/modules/web/http/web_node.cpp +++ b/modules/web/http/web_node.cpp @@ -58,6 +58,15 @@ void WebNode::set_uri_segment(const String &val) { } String WebNode::get_full_uri(const bool slash_at_the_end) { + // Special case for WebRoots for ease of use + if (_uri_segment == "/") { + if (slash_at_the_end) { + return _uri_segment; + } else { + return String(); + } + } + if (slash_at_the_end) { return get_full_uri_parent(true) + _uri_segment + "/"; } else { diff --git a/modules/web/nodes/folder_serve_nodes/browsable_folder_serve_web_page.cpp b/modules/web/nodes/folder_serve_nodes/browsable_folder_serve_web_page.cpp index 5b0d0784e..ee464a26d 100644 --- a/modules/web/nodes/folder_serve_nodes/browsable_folder_serve_web_page.cpp +++ b/modules/web/nodes/folder_serve_nodes/browsable_folder_serve_web_page.cpp @@ -140,10 +140,6 @@ void BrowsableFolderServeWebPage::render_dir_page(const String &dir_uri, const V String uri = get_full_uri(false); - if (uri == "/") { - uri = ""; - } - b.div("file_list"); { if (!top_level) {