Skip to main content

parse_range_header

Function parse_range_header 

Source
pub fn parse_range_header(
    header: Option<&str>,
    total: u64,
) -> Result<Option<ByteRange>, PodError>
Expand description

Parse a Range: header value of the form bytes=start-end or bytes=start- or bytes=-suffix. Multi-range is intentionally not supported — Solid Pods treat non-rangeable media (JSON-LD, Turtle) as opaque and the binary path is the only consumer.

Returns Ok(None) when the header is absent, Err when the header is syntactically valid but unsatisfiable (clients must receive 416 Range Not Satisfiable), and Ok(Some(range)) for the happy path.