Skip to main content

handle_stream_local_file

Function handle_stream_local_file 

Source
pub(super) async fn handle_stream_local_file(
    __arg0: Query<LocalFileQueryParams>,
    headers: HeaderMap,
) -> Response
Expand description

Media pane (SPEC_MEDIA_PANE_2026_07_26.md): serve an arbitrary local file by absolute path, for <img>/<video> display. Deliberately matches readeditorfile’s existing posture (any absolute path the frontend sends, gated by OS-level permissions rather than an in-app allowlist — see the “root scoping, not a sandbox” note on the macOS list_drives in editor_handlers.rs) so this route isn’t a stricter one-off next to an already-shipped read path with the same shape. Size-capped (see STREAM_LOCAL_FILE_MAX_BYTES) rather than truly unbounded.

Honours a single Range (206 Partial Content), so a <video> poster can read just the start of a file.