{"record":{"id":"25c8d07fe4500ca4","repo":"oven-sh/bun","slug":"invalidcontentlength","errorCode":null,"errorMessage":"InvalidContentLength","messagePattern":"InvalidContentLength","errorType":"exception","errorClass":"bun_http::Error","httpStatus":null,"severity":"error","filePath":"src/http/error.rs","lineNumber":60,"sourceCode":"    #[error(\"ConnectionClosed\")]\n    ConnectionClosed,\n    #[error(\"DNSResolveFailed\")]\n    DNSResolveFailed,\n    #[error(\"ConnectionRefused\")]\n    ConnectionRefused,\n    #[error(\"TooManyRedirects\")]\n    TooManyRedirects,\n    #[error(\"HTTP3Unsupported\")]\n    HTTP3Unsupported,\n    #[error(\"ResponseHeadersTooLarge\")]\n    ResponseHeadersTooLarge,\n    #[error(\"UnrequestedUpgrade\")]\n    UnrequestedUpgrade,\n    #[error(\"UnexpectedData\")]\n    UnexpectedData,\n    #[error(\"InvalidHTTPResponse\")]\n    InvalidHTTPResponse,\n    #[error(\"InvalidContentLength\")]\n    InvalidContentLength,\n    #[error(\"UnsupportedTransferEncoding\")]\n    UnsupportedTransferEncoding,\n    #[error(\"RequestBodyNotReusable\")]\n    RequestBodyNotReusable,\n    #[error(\"UnsupportedRedirectProtocol\")]\n    UnsupportedRedirectProtocol,\n    #[error(\"RedirectURLTooLong\")]\n    RedirectURLTooLong,\n    #[error(\"RedirectURLInvalid\")]\n    RedirectURLInvalid,\n    #[error(\"InvalidRedirectURL\")]\n    InvalidRedirectURL,\n    #[error(\"UnexpectedRedirect\")]\n    UnexpectedRedirect,\n    #[error(\"ShortRead\")]\n    ShortRead,\n    #[error(\"WantRead\")]","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/http/error.rs#L42-L78","documentation":"The Content-Length header value is invalid or inconsistent with the actual body. Fires when the declared length is negative, non-numeric, or conflicts with the bytes actually received on the body stream.","triggerScenarios":"Thrown at src/http/error.rs:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the server sends a correct Content-Length header matching the actual body size","For streaming responses, use chunked transfer encoding instead of a fixed Content-Length","Check for proxies or middleware that modify the body without updating Content-Length"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","contentChangedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}