pub async fn get_root_node_contents<BS: BlobService, DS: DirectoryService, S: AsRef<str>>(
blob_service: BS,
directory_service: DS,
base_path: &Path,
root_node: &Node,
requested_path: &Path,
range_header: Option<TypedHeader<Range>>,
index_names: &[S],
auto_index: bool,
) -> Result<Response, StatusCode>
Expand description
Helper function, descending from the given root_node
to the requested_path
specified.
Returns HTTP Responses or Status Codes.
If the path points to a regular file, it serves its contents.
If the path points to a symlink, it sends a redirect to the target (pretending base_path
, if relative)
If the path points to a directory, files of index_names
are tried,
if no files matched then a directory listing is returned if auto_index
is enabled.
Uses the passed BlobService and DirectoryService