Browse Source

secure test dump method

Bastien Sevajol (Algoo) 8 years ago
parent
commit
2f589d9aff
1 changed files with 2 additions and 1 deletions
  1. 2 1
      tracim/tracim/tests/__init__.py

+ 2 - 1
tracim/tracim/tests/__init__.py View File

@@ -51,7 +51,8 @@ class TestApp(BaseTestApp):
51 51
         try:
52 52
             super()._check_status(status, res)
53 53
         except AppError as exc:
54
-            dump_file_path = "/tmp/debug_%d_%s.html" % (time.time() * 1000, res.request.path_qs[1:])
54
+            escaped_page_name = res.request.path_qs[1:].replace('/', '')
55
+            dump_file_path = "/tmp/debug_%d_%s.html" % (time.time() * 1000, escaped_page_name)
55 56
             if os.path.exists("/tmp"):
56 57
                 with open(dump_file_path, 'w') as dump_file:
57 58
                     print(res.ubody, file=dump_file)