Skip to content

v0.2.0

Choose a tag to compare

@ianhi ianhi released this 22 Jun 16:14
f8d350f

Added

  • LatencyRangeServer.from_file(path, ...) — serve a single file directly, reachable at its basename, with no containing directory, no temp dir, no symlink, and no copy. It's streamed from disk via aiohttp's FileResponse (the same machinery directory mode uses), and because only the one pinned path is ever served there's no path-traversal surface (every other key 404s). The result is observationally a one-key directory server: describe(), files(), url(), and stats() behave identically to directory mode.
with LatencyRangeServer.from_file("CMU-1.tiff", latency=LogNormal(mode_ms=40)) as server:
    open_and_read(server.url("CMU-1.tiff"))

Full changelog: https://github.com/ianhi/snailmail/blob/v0.2.0/CHANGELOG.md