Skip to main content

Crate hyperlane_plugin_static_files

Crate hyperlane_plugin_static_files 

Source
Expand description

hyperlane-plugin-static-files

High-performance static file serving plugin for Hyperlane with path-traversal defense, Hyperlane FileExtension MIME detection, 64-way sharded hot-file caching, .br/.gz precompressed sidecars, ETag/304, RFC 9110 Range (206/416), and SPA fallback.

Structs§

StaticFilesConfig
Configuration for StaticFilesRuntime and StaticFilesPlugin.
StaticFilesHook
Opt-in ServerHook serving static assets on GET / HEAD requests under the configured mount prefix.
StaticFilesPlugin
Process-wide StaticFilesPlugin singleton storing StaticFilesRuntime.
StaticFilesRuntime
Thread-safe static asset engine with 64-way sharded hot-file caching and security checks.

Constants§

DEFAULT_STATIC_CACHE_CONTROL
Default Cache-Control header applied to served static files.
DEFAULT_STATIC_INDEX_FILE
Default directory index filename.
DEFAULT_STATIC_MAX_CACHE_BYTES
Default maximum total memory budget for the sharded hot-file cache (32 MiB).
DEFAULT_STATIC_MAX_FILE_CACHE_BYTES
Default maximum single file size eligible for in-memory hot caching (1 MiB).
DEFAULT_STATIC_MOUNT_PREFIX
Default URL mount prefix served by crate::StaticFilesHook.

Functions§

if_none_match_matches
Checks whether an If-None-Match header matches etag (handling *, comma lists, and W/ weak prefixes).
mime_for_path
Resolves the MIME Content-Type string for path with a zero-allocation fast table for common web assets.
parse_byte_range
Parses a single RFC 9110 byte Range header (bytes=start-end, bytes=start-, bytes=-suffix).
resolve_safe_path
Safely joins an untrusted relative URL path onto a canonicalized root_dir, rejecting traversal and dotfiles.