Skip to content

Commit a710da9

Browse files
committed
test(config): assert trusted_hosts by exact list (CodeQL URL-substring false positive)
CodeQL flagged 'myapp.example.com' in cfg.trusted_hosts as incomplete URL substring sanitization — a false positive on list-membership. Assert exact list equality instead; same meaning, no heuristic trip.
1 parent 1edd514 commit a710da9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/unit/config/test_server_schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,9 @@ def test_server_config_trusted_hosts_can_be_overridden():
357357
from orb.config.schemas.server_schema import ServerConfig
358358

359359
cfg = ServerConfig(trusted_hosts=["myapp.example.com", "localhost"]) # type: ignore[call-arg]
360-
assert "myapp.example.com" in cfg.trusted_hosts
360+
# Exact list comparison (not substring membership) — asserts the operator
361+
# override is preserved verbatim and avoids CodeQL's URL-substring heuristic.
362+
assert cfg.trusted_hosts == ["myapp.example.com", "localhost"]
361363

362364

363365
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)