1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-04 14:30:11 +01:00

checkupdates: require UpdateCheckData has valid HTTPS URL

This commit is contained in:
Hans-Christoph Steiner 2018-03-01 23:51:36 +01:00
parent 26bfd7fb28
commit 7da0747849

View File

@ -30,6 +30,7 @@ import html
from distutils.version import LooseVersion
import logging
import copy
import urllib.parse
from . import _
from . import common
@ -48,6 +49,13 @@ def check_http(app):
raise FDroidException('Missing Update Check Data')
urlcode, codeex, urlver, verex = app.UpdateCheckData.split('|')
parsed = urllib.parse.urlparse(urlcode)
if not parsed.netloc or not parsed.scheme or parsed.scheme != 'https':
raise FDroidException(_('UpdateCheckData has invalid URL: {url}').format(url=urlcode))
if urlver != '.':
parsed = urllib.parse.urlparse(urlver)
if not parsed.netloc or not parsed.scheme or parsed.scheme != 'https':
raise FDroidException(_('UpdateCheckData has invalid URL: {url}').format(url=urlcode))
vercode = "99999999"
if len(urlcode) > 0: