Skip to content

Commit c189220

Browse files
Cover env case-insensitive duplicate header rejection
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 075b6f1 commit c189220

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/test_config.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,22 @@ def test_client_config_from_env_rejects_duplicate_header_names_after_normalizati
107107
ClientConfig.from_env()
108108

109109

110+
def test_client_config_from_env_rejects_case_insensitive_duplicate_header_names(
111+
monkeypatch,
112+
):
113+
monkeypatch.setenv("HYPERBROWSER_API_KEY", "test-key")
114+
monkeypatch.setenv(
115+
"HYPERBROWSER_HEADERS",
116+
'{"X-Correlation-Id":"one","x-correlation-id":"two"}',
117+
)
118+
119+
with pytest.raises(
120+
HyperbrowserError,
121+
match="duplicate header names are not allowed after normalization",
122+
):
123+
ClientConfig.from_env()
124+
125+
110126
def test_client_config_from_env_ignores_blank_headers(monkeypatch):
111127
monkeypatch.setenv("HYPERBROWSER_API_KEY", "test-key")
112128
monkeypatch.setenv("HYPERBROWSER_HEADERS", " ")

0 commit comments

Comments
 (0)