Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client-ID header missing when providing own ClientSession #476

Closed
LostLuma opened this issue Dec 22, 2024 · 1 comment
Closed

Client-ID header missing when providing own ClientSession #476

LostLuma opened this issue Dec 22, 2024 · 1 comment
Assignees
Labels
3.x TwitchIO 3.0 Fixed/Implemented Fixed the issue/Implemented the requested feature

Comments

@LostLuma
Copy link
Member

When providing your own ClientSession for the client HTTPClient._init_session exits early and the Client-ID header will not be set on requests to Twitch, as it's set on the session instead of a per-request basis.

TwitchIO/twitchio/http.py

Lines 395 to 404 in 44c93a9

async def _init_session(self) -> None:
if self._session and not self._session.closed:
return
logger.debug("Initialising a new session on %s.", self.__class__.__qualname__)
session = self._session or aiohttp.ClientSession()
session.headers.update(self.headers)
self._session = session

@LostLuma LostLuma added the 3.x TwitchIO 3.0 label Dec 22, 2024
Copy link

Hello! Thanks for the issue. If this is a general help question, for a faster response consider joining the official Discord Server

Else if you have an issue with the library please wait for someone to help you here.

EvieePy added a commit that referenced this issue Dec 23, 2024
Only close non-user passed sessions, fixes #477
@EvieePy EvieePy self-assigned this Dec 23, 2024
@EvieePy EvieePy closed this as completed Dec 23, 2024
@EvieePy EvieePy added the Fixed/Implemented Fixed the issue/Implemented the requested feature label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x TwitchIO 3.0 Fixed/Implemented Fixed the issue/Implemented the requested feature
Projects
None yet
Development

No branches or pull requests

2 participants