From 3fc5d1502ec3a5701410ec2a4631fb89a2b35e80 Mon Sep 17 00:00:00 2001 From: Andrew Grant Date: Fri, 8 Jan 2021 20:42:19 -0500 Subject: [PATCH] Fix trailing slash issue, leave legacy broken one on server until Noob updates again --- Client/Client.py | 5 ++--- OpenBench/urls.py | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Client/Client.py b/Client/Client.py index 844ca47..8f04e5d 100644 --- a/Client/Client.py +++ b/Client/Client.py @@ -66,8 +66,7 @@ def pathjoin(*args): # Join a set of URL paths while maintaining the correct # format of "/"'s between each part of the URL's pathway - args = [f.lstrip("/").rstrip("/") for f in args] - return "/".join(args) + "/" + return '/'.join([f.lstrip('/').rstrip('/') for f in args]) + '/' def savedEngineName(sha256, network256): if not network256: return sha256 @@ -265,7 +264,7 @@ def getNetworkWeights(server, network): print ('Fetching and Verifying Network ({0})'.format(network)) fname = pathjoin('Networks', network).rstrip('/') if not os.path.isfile(fname): - getFile('{}/networks/download/{}'.format(server, network), fname) + getFile(pathjoin(server, 'networks', 'download', network), fname) with open(fname, 'rb') as weights: sha256 = hashlib.sha256(weights.read()).hexdigest()[:8].upper() diff --git a/OpenBench/urls.py b/OpenBench/urls.py index 1a9fd3b..d1503f7 100644 --- a/OpenBench/urls.py +++ b/OpenBench/urls.py @@ -53,6 +53,7 @@ urlpatterns = [ django.urls.path(r'networks/', OpenBench.views.networks), django.urls.path(r'networks//', OpenBench.views.networks), django.urls.path(r'networks//', OpenBench.views.networks), + django.urls.path(r'networks///', OpenBench.views.networks), # Links for the Client to work with the Server django.urls.path(r'clientGetFiles/', OpenBench.views.clientGetFiles),