Added docs to the folder serve nodes.

This commit is contained in:
Relintai 2022-02-14 23:49:27 +01:00
parent d4a636c15d
commit 4bd9975350
2 changed files with 17 additions and 0 deletions

View File

@ -6,6 +6,18 @@
#include "folder_serve_node.h"
// On top of serving the files from the folder set to it's serve_folder property,
// this class also generates HTML directory lists. (Similar to apache's directory listing)
// It caches folder contents on ENTER_TREE, it does not watch for folder changes yet.
// if (should_render_menu) -> render_menu(request)
// <div class="file_list">
// <div class="file_list_entry"><a href="/files/">..</a></div>
// <div class="file_list_entry"><a href="/files/test_folder/">(Folder) test_folder</a></div>
// <div class="file_list_entry"><a href="/files/test_file.md">(File) test_file.md</a></div>
// ...
// </div>
class BrowsableFolderServeNode : public FolderServeNode {
RCPP_OBJECT(BrowsableFolderServeNode, FolderServeNode);

View File

@ -6,6 +6,11 @@
#include "web/file_cache.h"
#include "web/http/web_node.h"
// This class will serve the files from the folder set to it's serve_folder property.
// It will cache the folder's contents on ENTER_TREE, and will match against the cached list,
// this means directory walking (for example sending http://webapp.com/files/../../../etc/passwd),
// and other techniques like it should not be possible.
class FolderServeNode : public WebNode {
RCPP_OBJECT(FolderServeNode, WebNode);