{"record":{"id":"8879dc1f99e99137","repo":"Zackriya-Solutions/meetily","slug":"malformed-content-range-range","errorCode":null,"errorMessage":"Malformed Content-Range range: {}","messagePattern":"Malformed Content-Range range: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs","lineNumber":215,"sourceCode":"        .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\n        .parse()\n        .map_err(|e| anyhow!(\"Invalid Content-Range end: {}\", e))?;\n    let total = total\n        .parse()\n        .map_err(|e| anyhow!(\"Invalid Content-Range total: {}\", e))?;\n    if start > end {\n        return Err(anyhow!(\"Content-Range start exceeds end: {}\", value));\n    }\n\n    Ok(ContentRange::Range { start, end, total })\n}\n\n#[derive(Debug)]\npub enum ParakeetEngineError {","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/a2cb62e827da7ef59f65064c97233efb2313878e/frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs#L197-L233","documentation":"Thrown by parse_content_range when the portion before '/' in a Content-Range header cannot be split into 'start-end' with a '-' separator. The header had a total part but the byte-range portion itself is malformed, so the range bounds cannot be determined.","triggerScenarios":"A 206 partial-content response from the model server has a Content-Range like 'bytes 01023/2048' or 'bytes /2048' — no '-' between start and end — while validate_partial_response or validate_unsatisfied_response is checking a resumed download.","commonSituations":"Custom/non-standard model mirrors emitting hand-written range headers; header values mangled by middleware; tests feeding fake header strings with wrong separators (e.g. '0..1023/2048').","solutions":["Correct the mirror/server so it emits 'bytes start-end/total' format","Inspect the raw header value logged in the error message","Test the endpoint with curl -r to confirm correct '-' separator","If you control the client, trim whitespace or 'bytes=' prefix before parsing"],"exampleFix":"// malformed value fed to parser\n// before: Content-Range: bytes 01023/2048\n// after:  Content-Range: bytes 0-1023/2048","handlingStrategy":"validation","validationCode":"fn valid_range_part(v: &str) -> bool { let main = v.trim().trim_start_matches(\"bytes \"); main.split_once('/').map_or(false, |(r, _)| r.split_once('-').is_some()) }","typeGuard":null,"tryCatchPattern":"match parse_content_range(header_value) { Err(e) => { log::warn!(\"bad Content-Range: {e}\"); restart_download_from_scratch() }, Ok(cr) => resume(cr) }","preventionTips":["Normalize headers (trim, strip 'bytes=' prefix) before parsing","Unit-test the parser with real server header samples","Reject mirrors that emit non-standard range syntax early in setup"],"tags":["http","content-range","parsing","resumable-download"],"backgroundTag":"invalid-argument-format","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"}