From 374e1b71fb4002dc5590093891081386f2918e0c Mon Sep 17 00:00:00 2001 From: EvieePy <29671945+EvieePy@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:48:34 +1000 Subject: [PATCH] Add not about cast to str in http headers. --- twitchio/http.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/twitchio/http.py b/twitchio/http.py index 777f4332..4fbb12c6 100644 --- a/twitchio/http.py +++ b/twitchio/http.py @@ -460,7 +460,10 @@ def __init__(self, session: aiohttp.ClientSession = MISSING, *, client_id: str) @property def headers(self) -> dict[str, str]: - return {"User-Agent": self.user_agent, "Client-ID": self._client_id} + # If the user somehow gets a client_id passed that isn't a str + # this will allow Twitch to throw a reasonable HTTPException + + return {"User-Agent": self.user_agent, "Client-ID": str(self._client_id)} async def _init_session(self) -> None: if self._session_set: