浏览代码

secure test dump method

Bastien Sevajol (Algoo) 8 年前
父节点
当前提交
2f589d9aff
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      tracim/tracim/tests/__init__.py

+ 2 - 1
tracim/tracim/tests/__init__.py 查看文件

@@ -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)