1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-05 18:50:09 +02:00

checkupdates: set User-Agent to make gitlab.com happy

closes #863
This commit is contained in:
Hans-Christoph Steiner 2021-02-02 21:37:53 +01:00
parent 682761e75d
commit fc7f9204b6

View File

@ -35,6 +35,7 @@ import urllib.parse
from . import _
from . import common
from . import metadata
from . import net
from .exception import VCSException, NoSubmodulesException, FDroidException, MetaDataException
@ -63,7 +64,7 @@ def check_http(app):
vercode = None
if len(urlcode) > 0:
logging.debug("...requesting {0}".format(urlcode))
req = urllib.request.Request(urlcode, None)
req = urllib.request.Request(urlcode, None, headers=net.HEADERS)
resp = urllib.request.urlopen(req, None, 20) # nosec B310 scheme is filtered above
page = resp.read().decode('utf-8')