Skip to content

Commit 95dbd17

Browse files
committed
disable caching through header and reset session after each update
1 parent 6247d98 commit 95dbd17

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

weconnect/auth/we_connect_session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def __init__(self, sessionuser, **kwargs):
4242
'x-newrelic-id': 'VgAEWV9QDRAEXFlRAAYPUA==',
4343
'user-agent': 'WeConnect/3 CFNetwork/1331.0.7 Darwin/21.4.0',
4444
'accept-language': 'de-de',
45+
'Cache-Control': 'no-cache',
46+
'Pragma': 'no-cache'
4547
})
4648

4749
def request(

weconnect/weconnect.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def update(self, updateCapabilities: bool = True, updatePictures: bool = True, f
181181
self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
182182
self.updateChargingStations(force=force)
183183
self.updateComplete()
184+
self.__session.cookies.clear() # Clear cookies to have a fresh session afterwards
184185

185186
def updateVehicles(self, updateCapabilities: bool = True, updatePictures: bool = True, force: bool = False, # noqa: C901
186187
selective: Optional[list[Domain]] = None) -> None:

0 commit comments

Comments
 (0)