Problem
The [response_headers] config supports setting custom HTTP response headers via TOML, but setting them via environment variables loses header name casing and hyphens.
For example, TRUSTED_SERVER__RESPONSE_HEADERS__X_ROBOTS_TAG="noindex" results in the header key x_robots_tag instead of X-Robots-Tag, because the config crate lowercases env var names and can't represent hyphens.
Solution
Support a JSON object string as the env var value:
TRUSTED_SERVER__RESPONSE_HEADERS='{"X-Robots-Tag": "noindex", "X-Custom-Header": "custom value"}'
This preserves exact header name casing and hyphens. The existing TOML [response_headers] table format continues to work unchanged.
Acceptance Criteria
Problem
The
[response_headers]config supports setting custom HTTP response headers via TOML, but setting them via environment variables loses header name casing and hyphens.For example,
TRUSTED_SERVER__RESPONSE_HEADERS__X_ROBOTS_TAG="noindex"results in the header keyx_robots_taginstead ofX-Robots-Tag, because theconfigcrate lowercases env var names and can't represent hyphens.Solution
Support a JSON object string as the env var value:
TRUSTED_SERVER__RESPONSE_HEADERS='{"X-Robots-Tag": "noindex", "X-Custom-Header": "custom value"}'This preserves exact header name casing and hyphens. The existing TOML
[response_headers]table format continues to work unchanged.Acceptance Criteria