Skip to content

Commit

Permalink
Add not about cast to str in http headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed Jan 7, 2025
1 parent d7e9e3b commit 374e1b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion twitchio/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 374e1b7

Please sign in to comment.