{"record":{"id":"692ce1e97cb30935","repo":"hasura/graphql-engine","slug":"invalid-header-name-header-name-error-692ce1","errorCode":null,"errorMessage":"Invalid header name {header_name}: {error}","messagePattern":"Invalid header name (.+?): (.+?)","errorType":"validation","errorClass":"BuildRequestError","httpStatus":null,"severity":"error","filePath":"v3/crates/plugins/pre-ndc-response-plugin/src/execute.rs","lineNumber":40,"sourceCode":"    #[error(\"Unexpected status code: {0}\")]\n    UnexpectedStatusCode(u16),\n    #[error(\"Error parsing the request: {0}\")]\n    PluginRequestParseError(serde_json::error::Error),\n    #[error(\"Internal error from plugin {plugin_name}\")]\n    PluginInternalError {\n        plugin_name: String,\n        error: serde_json::Value,\n    },\n    #[error(\"User error from plugin {plugin_name}\")]\n    PluginUserError {\n        plugin_name: String,\n        error: serde_json::Value,\n    },\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum BuildRequestError {\n    #[error(\"Invalid header name {header_name}: {error}\")]\n    InvalidHeaderName {\n        header_name: String,\n        #[source]\n        error: InvalidHeaderName,\n    },\n    #[error(\"Invalid header value for header {header_name}: {error}\")]\n    InvalidHeaderValue {\n        header_name: HeaderName,\n        #[source]\n        error: InvalidHeaderValue,\n    },\n    #[error(\"Failed to convert session: {0}\")]\n    SessionConversionError(String),\n    #[error(\"Failed to convert session variable '{variable_name}': {error}\")]\n    SessionVariableConversionError {\n        variable_name: SessionVariableName,\n        error: serde_json::Error,\n    },","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/plugins/pre-ndc-response-plugin/src/execute.rs#L22-L58","documentation":"While building the HTTP request to the pre-NDC-response plugin, a configured header name failed conversion to http::HeaderName. The offending name and underlying error are shown. Header names must be ASCII token characters — spaces, control bytes, and non-ASCII characters are invalid.","triggerScenarios":"Plugin webhook config lists forwarded headers and one name is malformed (spaces, newlines, non-ASCII), causing BuildRequestError::InvalidHeaderName during request construction.","commonSituations":"Hand-edited YAML config with typos; header names built from env vars that resolve to empty/garbled strings; copy-paste introducing smart quotes.","solutions":["Correct the header name in the plugin config to a valid token (letters, digits, '-')","Remove invisible characters/whitespace from the config value","Audit env-var interpolation used to build header names","Add config validation in CI to catch malformed header names early"],"exampleFix":"# before\nforward_headers: [\"x_user_id\"]\n# after\nforward_headers: [\"x-user-id\"]","handlingStrategy":"validation","validationCode":"fn valid_header_name(s: &str) -> bool {\n    !s.is_empty() && s.bytes().all(|b| b.is_ascii_alphanumeric() || b == b'-')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Lint header-name syntax in config CI","Avoid constructing header names from raw env vars"],"tags":["rust","http-headers","configuration","plugin"],"backgroundTag":"invalid-http-header-name","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}