{"record":{"id":"4b2015d615cfe990","repo":"Zackriya-Solutions/meetily","slug":"content-range-must-use-bytes","errorCode":null,"errorMessage":"Content-Range must use bytes: {}","messagePattern":"Content-Range must use bytes: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs","lineNumber":201,"sourceCode":"#[cfg(test)]\nstruct ModelLifecycleTestHook {\n    load_started: tokio::sync::Notify,\n    continue_load: tokio::sync::Notify,\n    unload_attempted: tokio::sync::Notify,\n}\n\nenum ContentRange {\n    Range { start: u64, end: u64, total: u64 },\n    Unsatisfied { total: u64 },\n}\n\nfn parse_content_range(value: &reqwest::header::HeaderValue) -> Result<ContentRange> {\n    let value = value\n        .to_str()\n        .map_err(|e| anyhow!(\"Invalid Content-Range header encoding: {}\", e))?;\n    let value = value\n        .strip_prefix(\"bytes \")\n        .ok_or_else(|| anyhow!(\"Content-Range must use bytes: {}\", value))?;\n\n    if let Some(total) = value.strip_prefix(\"*/\") {\n        return total\n            .parse()\n            .map(|total| ContentRange::Unsatisfied { total })\n            .map_err(|e| anyhow!(\"Invalid unsatisfied Content-Range total: {}\", e));\n    }\n\n    let (range, total) = value\n        .split_once('/')\n        .ok_or_else(|| anyhow!(\"Malformed Content-Range: {}\", value))?;\n    let (start, end) = range\n        .split_once('-')\n        .ok_or_else(|| anyhow!(\"Malformed Content-Range range: {}\", value))?;\n    let start = start\n        .parse()\n        .map_err(|e| anyhow!(\"Invalid Content-Range start: {}\", e))?;\n    let end = end","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/a2cb62e827da7ef59f65064c97233efb2313878e/frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs#L183-L219","documentation":"parse_content_range requires the Content-Range value to start with 'bytes ' (RFC 7233). If the header exists but lacks that prefix, it fails with 'Content-Range must use bytes: {value}'. This guards the Parakeet engine's ranged model download/resume logic which only supports byte ranges.","triggerScenarios":"validate_partial_response/validate_unsatisfied_response receiving a Content-Range header like 'items 0-99/200', 'none', or any non-'bytes ' unit, typically from a 206/416 response of a non-conforming server.","commonSituations":"Server/proxy not honoring Range requests and replying with a differently-unitied Content-Range; a CDN or dev mock returning a non-standard unit; a 416 response formatted with 'bytes */total' missing the 'bytes ' prefix entirely.","solutions":["Verify the model server supports Range requests (Accept-Ranges: bytes) and standard byte units.","Send 'Range: bytes=N-' explicitly and confirm the response is 206 with 'bytes ...' Content-Range.","Bypass or reconfigure the proxy/CDN that rewrites headers.","Fall back to a full (non-resumable) download when the unit is unsupported."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let ok = resp.status() == 206 && resp\n    .headers()\n    .get(CONTENT_RANGE)\n    .and_then(|v| v.to_str().ok())\n    .map_or(false, |v| v.starts_with(\"bytes \"));\nif !ok { fallback_to_full_download(); }","typeGuard":"fn has_byte_content_range(resp: &reqwest::Response) -> bool {\n    resp.headers().get(reqwest::header::CONTENT_RANGE)\n        .and_then(|v| v.to_str().ok())\n        .map_or(false, |v| v.starts_with(\"bytes \"))\n}","tryCatchPattern":"if !has_byte_content_range(&resp) {\n    warn!(\"non-bytes Content-Range; resuming unsupported\");\n    return download_without_resume(url).await;\n}","preventionTips":["Verify the server honors Range: bytes=N- before relying on resume.","Reject or bypass CDNs/proxies that rewrite Content-Range units.","Always provide a non-resume full-download fallback.","Add an integration test asserting 'bytes ' prefixed 206 responses."],"tags":["http","headers","range-request","protocol"],"backgroundTag":"unexpected-response-shape","analyzedSha":"a2cb62e827da7ef59f65064c97233efb2313878e","analyzedAt":"2026-09-12T11:12:14.152Z","contentChangedAt":"2026-09-12T11:12:14.152Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}