Skip to content

Commit 5aa4e0b

Browse files
committed
Ensure the response is read before accessing response.text
1 parent ee54acb commit 5aa4e0b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/mcp/client/auth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ async def _register_client(self) -> httpx.Request | None:
308308
async def _handle_registration_response(self, response: httpx.Response) -> None:
309309
"""Handle registration response."""
310310
if response.status_code not in (200, 201):
311+
await response.aread()
311312
raise OAuthRegistrationError(f"Registration failed: {response.status_code} {response.text}")
312313

313314
try:

0 commit comments

Comments
 (0)