From 634a7c247165c87dc94a83e7f5e15fe4dc574d7c Mon Sep 17 00:00:00 2001 From: assar Date: Tue, 6 Jun 2017 19:11:52 +0000 Subject: [PATCH] More fixes --- server.py | 4 ++-- static/script.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index ebec14a..ef45901 100644 --- a/server.py +++ b/server.py @@ -55,10 +55,10 @@ def query(filter, query): @app.route('/parts/getfile/') def getfile(filename): - if(re.match('^[\w\-_]+\.pdf$', filename) == None): + if(re.match('^[\w\-_]+$', filename) == None): return 'No injections pls.' - return send_from_directory('/srv/datasheets/', 'filename') + return send_from_directory('/srv/datasheets/', filename + '.pdf') @app.route('/parts/alter/', methods=['POST']) def alter(partID): diff --git a/static/script.js b/static/script.js index 6268b0e..89c1063 100644 --- a/static/script.js +++ b/static/script.js @@ -235,7 +235,7 @@ $(document).ready(function() { newResults += '
'; if (data[i].datasheet != null) - newResults += ''; + newResults += ''; newResults += '
'; newResults += '' newResults += '';