{"record":{"id":"f8ec83d37a75d6a1","repo":"headroomlabs-ai/headroom","slug":"unsupported-content-encoding-encoding","errorCode":null,"errorMessage":"Unsupported Content-Encoding: {encoding}","messagePattern":"Unsupported Content-Encoding: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"headroom/proxy/helpers.py","lineNumber":2438,"sourceCode":"        import zlib\n\n        try:\n            raw = zlib.decompress(raw)\n        except Exception as exc:\n            raise ValueError(f\"Failed to decompress deflate request body: {exc}\") from exc\n    elif encoding == \"br\":\n        try:\n            import brotli\n\n            raw = brotli.decompress(raw)\n        except ImportError:\n            raise ValueError(\n                \"Request body is brotli-compressed but the 'brotli' package is not installed.\"\n            ) from None\n        except Exception as exc:\n            raise ValueError(f\"Failed to decompress brotli request body: {exc}\") from exc\n    elif encoding and encoding != \"identity\":\n        raise ValueError(f\"Unsupported Content-Encoding: {encoding}\")\n\n    return cast(bytes, raw)\n\n\n# ---------------------------------------------------------------------------\n# Output-only content blocks\n# ---------------------------------------------------------------------------\n# The Anthropic *response* schema can emit signaling blocks that the *request*\n# schema (messages[].content[]) does not accept. The primary case is the\n# server-side refusal fallback notification introduced with the\n# ``server-side-fallback-2026-06-01`` beta::\n#\n#     {\"type\": \"fallback\",\n#      \"from\": {\"model\": \"claude-fable-5\"},\n#      \"to\":   {\"model\": \"claude-opus-4-8\"}}\n#\n# The API returns it inside an assistant turn to signal that a refused request\n# was transparently re-served by the fallback model. When a client replays that","sourceCodeStart":2420,"sourceCodeEnd":2456,"githubUrl":"https://github.com/headroomlabs-ai/headroom/blob/322425c43bffde1ed0b64fecf3cf5951565dd82b/headroom/proxy/helpers.py#L2420-L2456","documentation":"Error \"Unsupported Content-Encoding: {encoding}\" thrown in headroomlabs-ai/headroom.","triggerScenarios":"Raised when a request arrives with a Content-Encoding the proxy does not know how to decompress.","commonSituations":"See trigger scenarios.","solutions":["Send the request body with a supported Content-Encoding: identity, gzip, deflate, br, or zstd","Remove or fix the unsupported Content-Encoding header '{encoding}' on the client","If the encoding is legitimate but unsupported, decode it client-side before proxying"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"322425c43bffde1ed0b64fecf3cf5951565dd82b","analyzedAt":"2026-08-15T01:03:05.481Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}