pub struct Config {
pub base_path: String,
pub base_url: Option<String>,
pub max_size: u64,
pub extensions: Extensions,
pub lock_timeout: Duration,
pub cors: CorsConfig,
pub trust_forwarded_headers: bool,
pub hooks: HookConfig,
pub enable_download: bool,
}Expand description
Top-level handler configuration.
Fields§
§base_path: StringURL path prefix where upload resources are rooted, e.g. "/files/".
Used to build the Location header value on POST responses.
base_url: Option<String>Optional absolute base URL override (e.g. "https://uploads.example.com").
When None the handler builds the Location from the request’s Host header.
max_size: u64Maximum allowed Upload-Length in bytes. 0 means no server-imposed limit.
extensions: ExtensionsEnabled protocol extensions.
lock_timeout: DurationHow long to wait when acquiring a per-upload lock before returning 408.
cors: CorsConfigCORS headers on responses.
trust_forwarded_headers: boolWhen base_url is unset, use X-Forwarded-Proto / X-Forwarded-Host to build absolute
URLs (e.g. behind TLS termination). Only enable when this service is not directly exposed
to untrusted clients (forwarded headers can be spoofed).
hooks: HookConfigHook callbacks and event-channel configuration.
enable_download: boolAllow HTTP GET on upload URLs to download completed data (tus-style downloads).
When false, GET returns 405.