Fix issues with GitHub rejecting the requests

This commit is contained in:
Théophile Diot 2023-09-18 11:54:18 +02:00
parent 7c5177bf43
commit 69307fba6f
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06
2 changed files with 8 additions and 2 deletions

View file

@ -76,7 +76,12 @@ try:
content = Path(normpath(plugin_urls[7:])).read_bytes()
else:
content = b""
resp = get(plugin_url, stream=True, timeout=10)
resp = get(
plugin_url,
headers={"User-Agent": "BunkerWeb"},
stream=True,
timeout=30,
)
if resp.status_code != 200:
logger.warning(f"Got status code {resp.status_code}, skipping...")

View file

@ -29,8 +29,9 @@ try:
response = get(
"https://github.com/bunkerity/bunkerweb/releases/latest",
headers={"User-Agent": "BunkerWeb"},
allow_redirects=True,
timeout=5,
timeout=10,
)
response.raise_for_status()