diff --git a/integration_test/src/python/http_server/BUILD b/integration_test/src/python/http_server/BUILD index 80f22be4609..7833e0da3f8 100644 --- a/integration_test/src/python/http_server/BUILD +++ b/integration_test/src/python/http_server/BUILD @@ -8,6 +8,7 @@ pex_binary( main = "main.py", reqs = [ "tornado==4.5.3", + "werkzeug==2.0.2", ], deps = [ "//heron/common/src/python:common-py", diff --git a/integration_test/src/python/http_server/main.py b/integration_test/src/python/http_server/main.py index 95c396c5867..c1a57b2bcf7 100644 --- a/integration_test/src/python/http_server/main.py +++ b/integration_test/src/python/http_server/main.py @@ -21,6 +21,7 @@ import tornado.ioloop import tornado.escape import tornado.web +from werkzeug.utils import secure_filename from heron.common.src.python.utils import log @@ -32,7 +33,7 @@ def get(self): class FileHandler(tornado.web.RequestHandler): def get(self, fileName): - jsonFilePath = RESULTS_DIRECTORY + "/" + fileName + ".json" + jsonFilePath = RESULTS_DIRECTORY + "/" + secure_filename(fileName) + ".json" if not os.path.exists(jsonFilePath): self.clear() @@ -46,7 +47,7 @@ def get(self, fileName): self.write(data) def post(self, fileName): - jsonFilePath = RESULTS_DIRECTORY + "/" + fileName + ".json" + jsonFilePath = RESULTS_DIRECTORY + "/" + secure_filename(fileName) + ".json" #Overwrites the existing file with open(jsonFilePath, "w") as jsonFile: