Skip to content

Commit

Permalink
fix(volvo_software_update): fix headers to prevent blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
fhempy committed Nov 19, 2022
1 parent 4f7c619 commit 09a7bdf
Showing 1 changed file with 14 additions and 1 deletion.
Expand Up @@ -32,8 +32,21 @@ async def Define(self, hash, args, argsh):
async def update_loop(self):
while True:
# aiohttp get
headers = {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"accept-language": "en-AT,en;q=0.9,de-AT;q=0.8,de;q=0.7,en-GB;q=0.6,en-US;q=0.5",
"sec-ch-ua": '"Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"Chrome OS"',
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"User-Agent": "Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
}
try:
async with aiohttp.ClientSession() as session:
async with aiohttp.ClientSession(headers=headers) as session:
async with session.get(self.update_url) as resp:
if resp.status == 200:
await self.handle_response(await resp.text())
Expand Down

0 comments on commit 09a7bdf

Please sign in to comment.