From 99ba6173a5f463c4bfe130626b127ffac033b4ad Mon Sep 17 00:00:00 2001 From: Nathan Spencer Date: Tue, 17 Sep 2024 18:19:50 +0000 Subject: [PATCH] Add dc-cid header to graphql queries --- src/rivian/rivian.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rivian/rivian.py b/src/rivian/rivian.py index ebbc3c4..832f0db 100644 --- a/src/rivian/rivian.py +++ b/src/rivian/rivian.py @@ -153,7 +153,6 @@ async def authenticate(self, username: str, password: str) -> None: "Csrf-Token": self._csrf_token, "A-Sess": self._app_session_token, "Apollographql-Client-Name": APOLLO_CLIENT_NAME, - "Dc-Cid": f"m-ios-{uuid.uuid4()}", } graphql_json = { @@ -638,6 +637,9 @@ async def __graphql_query( self._session = aiohttp.ClientSession() self._close_session = True + if "dc-cid" not in headers: + headers["dc-cid"] = f"m-ios-{uuid.uuid4()}" + try: async with async_timeout.timeout(self.request_timeout): response = await self._session.request(