Skip to content

armgit / sie

Public Imported from GitHub
0

Open-source inference server and production cluster for all the models your agent needs.

test(mcp): assert exact metadata origins for malformed hosts

krisztian-gajdarba1e91b0b833
diff --git a/packages/sie_mcp/tests/test_oauth.py b/packages/sie_mcp/tests/test_oauth.py
index 4b765008f..07e9aae35 100644
--- a/packages/sie_mcp/tests/test_oauth.py
+++ b/packages/sie_mcp/tests/test_oauth.py
@@ -262,7 +262,11 @@ def test_metadata_handles_malformed_ipv6_host(path: str, pinned: bool) -> None:
assert resp.status_code == (200 if pinned else 503)
assert "[::::]" not in resp.text
if pinned:
- assert "https://mcp.example.com" in resp.text
+ body = resp.json()
+ if "issuer" in body:
+ assert body["issuer"] == "https://mcp.example.com"
+ else:
+ assert body["authorization_servers"] == ["https://mcp.example.com"]
def test_metadata_served_for_loopback_host_when_unpinned() -> None: