From b72c0dfcb247f4d72717f6c679fa184a31d947d6 Mon Sep 17 00:00:00 2001 From: Volodymyr Shcherbyna Date: Fri, 4 Sep 2020 23:11:49 +0200 Subject: [PATCH] Enforce HTTPS urls for network files (#78) Drop requirement for them to be on Github. Noobpwnftw will be hosting a server for the NNUE files. @vshcherbyna has more information. --- OpenBench/utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenBench/utils.py b/OpenBench/utils.py index 2e29d44..b1c5f59 100644 --- a/OpenBench/utils.py +++ b/OpenBench/utils.py @@ -203,9 +203,9 @@ def verifyNewTest(request): if request.POST[field] not in OpenBench.config.OPENBENCH_CONFIG[parent].keys(): errors.append('{0} was not found in the configuration'.format(fieldName)) - def verifyGithubLink(field, fieldName): - if request.POST[field] and not request.POST[field].startswith('https://github.com/'): - errors.append('{0} must be located on a Github URL'.format(fieldName)) + def verifySecureLink(field, fieldName): + if request.POST[field] and not request.POST[field].startswith('https://'): + errors.append('{0} must be located on a HTTPS URL'.format(fieldName)) verifications = [ (verifyInteger, 'priority', 'Priority'), @@ -225,8 +225,8 @@ def verifyNewTest(request): (verifyOptions, 'baseoptions', 'Hash', 'Base Options'), (verifyConfiguration, 'enginename', 'Engine', 'engines'), (verifyConfiguration, 'bookname', 'Book', 'books'), - (verifyGithubLink, 'devnetwork', 'Dev Network'), - (verifyGithubLink, 'basenetwork', 'Base Network'), + (verifySecureLink, 'devnetwork', 'Dev Network'), + (verifySecureLink, 'basenetwork', 'Base Network'), ] for verification in verifications: