{"record":{"id":"c4bcb3119b9f5c50","repo":"Zackriya-Solutions/meetily","slug":"invalid-content-range-header-encoding","errorCode":null,"errorMessage":"Invalid Content-Range header encoding: {}","messagePattern":"Invalid Content-Range header encoding: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs","lineNumber":198,"sourceCode":"    continue_discovery: tokio::sync::Notify,\n}\n\n#[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","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/a2cb62e827da7ef59f65064c97233efb2313878e/frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs#L180-L216","documentation":"parse_content_range converts a reqwest HeaderValue to &str via to_str(). HeaderValue::to_str errors when the header contains non-visible-ASCII bytes, and that error is wrapped as 'Invalid Content-Range header encoding'. It is thrown while validating a 206 Partial Content (or 416) response from a Parakeet model server.","triggerScenarios":"validate_partial_response/validate_unsatisfied_response reading a Content-Range header whose bytes are not valid visible ASCII (per HTTP spec, essentially impossible from a compliant server, so usually a corrupted/proxied/mangled response).","commonSituations":"Misbehaving proxy or middleware injecting header values with UTF-8/non-ASCII characters; a mock/dev server writing headers incorrectly; binary corruption between server and client.","solutions":["Inspect the raw response headers (curl -i) to find what is corrupting Content-Range.","Fix or bypass the proxy/intermediate server mangling headers.","If you control the server, ensure it emits ASCII Content-Range like 'bytes 0-1023/4096'.","As a fallback, fall back to a non-range (full) download path when the header is unparseable."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match resp.headers().get(CONTENT_RANGE) {\n    Some(h) => match parse_content_range(h) {\n        Ok(cr) => use_range(cr),\n        Err(_) => fallback_to_full_download(), // header unusable\n    },\n    None => fallback_to_full_download(),\n}","preventionTips":["Check Accept-Ranges: bytes support before issuing ranged requests.","Test the model server/proxy chain with curl -i to catch header mangling early.","Treat unparseable Content-Range as 'resume unsupported' and download fully.","Log raw header bytes when validation fails."],"tags":["http","headers","encoding","range-request"],"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-14T00:17:10.932Z"}