diff --git a/owasp-top10-2021-apps/a3/sstype/src/public/index.html b/owasp-top10-2021-apps/a3/sstype/src/public/index.html index b15091780..bcb6bc90c 100644 --- a/owasp-top10-2021-apps/a3/sstype/src/public/index.html +++ b/owasp-top10-2021-apps/a3/sstype/src/public/index.html @@ -28,7 +28,7 @@

-

Hello: NAMEHERE

+

Hello: {{ name }}

Try with /?name=YourName

\ No newline at end of file diff --git a/owasp-top10-2021-apps/a3/sstype/src/server.py b/owasp-top10-2021-apps/a3/sstype/src/server.py index 4455395f3..1b3d116eb 100644 --- a/owasp-top10-2021-apps/a3/sstype/src/server.py +++ b/owasp-top10-2021-apps/a3/sstype/src/server.py @@ -6,15 +6,14 @@ TEMPLATE = open(os.path.join(os.path.dirname(__file__)) + "/public/index.html", 'r').readlines() tmpl = '' -for t in TEMPLATE: - tmpl += t +for strg in TEMPLATE: + tmpl += strg +t = tornado.template.Template(tmpl) class MainHandler(tornado.web.RequestHandler): def get(self): - name = self.get_argument('name', '') - template_data = tmpl.replace("NAMEHERE",name) - t = tornado.template.Template(template_data) + name = self.get_argument('name', '') self.write(t.generate(name=name)) application = tornado.web.Application([