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 += '';