Expand description
Serve files from the served directories without following symbolic links out of them (the default; see โfollow-symlinks).
Files are streamed, with Last-Modified and ETag for revalidation
(If-None-Match, If-Modified-Since) and single byte ranges, as
tower-httpโs ServeDir does.
Structsยง
- Roots
- The directories files are served from, in order, each with its real path (symbolic links resolved).
- Validators ๐
- The validators of a file: its
ETagand its modification time.
Enumsยง
- Found ๐
- What a request path names.
- Part ๐
- The part of a file of
lenbytes that aRangeheader asks for.
Constantsยง
- CHUNK ๐
- The bytes read from a file at a time.
Functionsยง
- is_
opened ๐ - Whether the file at
realisopened(whose metadata ismeta). - open_
file ๐ - Open
filefor reading, without blocking should it be a FIFO. - part ๐
- Read a
Rangeheader. Only one range of bytes is served; anything else, several ranges or one that does not parse, gets the whole file. - respond ๐
- The response for an opened file: 304, 206, 416 or 200, streamed.
- secs ๐
- serve
- Serve a file from
roots, refusing those reached through a symbolic link that leads out of them (see โfollow-symlinks). - stream ๐
countbytes offilefromfirst, read a chunk at a time as the client takes them, so that memory does not grow with the fileโs size.- windows_
unsafe ๐ - Whether Windows would take
segmentfor something other than the file it names: a device (NUL,COM1.txt), or a name it trims (a.bob.,a.bob) and so opens another file under.