Skip to main content

resolve

Function resolve 

Source
pub fn resolve(header: &str, if_range: Option<&str>, size: u64) -> Resolved
Expand description

Resolve a Range header against a known size.

Declines in two directions, both deliberate and both permitted.

A multi-range request is answered whole. Honouring it means emitting multipart/byteranges, which is a lot of surface for something no browser needs in order to seek in a video or a PDF, and RFC 9110 allows answering with the whole representation instead.

An If-Range is never honoured. The spec permits If-Range only with a strong validator, and the only validator this daemon offers is weak, because SFTP reports mtime in whole seconds. The specified outcome of that condition evaluating false is the whole representation, not a 412.