{"version":"2.1.227","anchor":"bad-http-header-values-are-rejected-before-the-request-inste","canonical_anchor":"bad-http-header-values-are-rejected-before-the-request-inste","heading":"Bad HTTP header values are rejected before the request instead of crashing","tier":"notice","area":"Auth","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.227\/e\/bad-http-header-values-are-rejected-before-the-request-inste","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.227","markdown":"### Bad HTTP header values are rejected before the request instead of crashing\n\nIllegal header values from your env or key helper now fail clearly instead of crashing.\n\n**What**\n\nIf a header value coming from `ANTHROPIC_CUSTOM_HEADERS`, an API key environment variable, or `apiKeyHelper` is not a legal HTTP header value, Claude Code now fails with a clear error before sending, classified as your mistake rather than an internal crash.\n\n**Details**\n\n- New `InvalidRequestHeaderValueError`, classified as `invalid_request_header` or `invalid_api_key` when the value is user-supplied.\n- Logged at error level rather than reported as a crash.\n- Treated as non-retryable during API key verification, so a malformed key value fails immediately.\n- The error class does not exist in v2.1.226.\n\n**Evidence**\n\n`request header value rejected before send: not a valid HTTP header value`\n\n- Area: Auth\n- Names: `ANTHROPIC_CUSTOM_HEADERS`, `apiKeyHelper`\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 1\/5"}