From 40186ad08e1b78da3cdc8717abeb138094870e93 Mon Sep 17 00:00:00 2001 From: Davide Bongiovanni Date: Tue, 13 Nov 2018 21:51:56 +0100 Subject: [PATCH] Fixed getfile --- parts/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parts/server.py b/parts/server.py index 8dc168d..dfdafa7 100644 --- a/parts/server.py +++ b/parts/server.py @@ -197,10 +197,10 @@ def getMap(containerID): @app.route('/parts/getfile/') def getfile(filename): - if(re.match('^[\w\-_]+$', filename) == None): + if(re.match('^[\w\-_]+.[p|P][d|D][f|F]$', filename) == None): return 'No injections pls.' - return send_from_directory('/srv/datasheets/', filename + '.pdf') + return send_from_directory('/srv/datasheets/', filename) @app.route('/parts/alter/', methods=['POST']) @requires_auth