From f004326855126e01e7a095fc65562c41060ffbed Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 27 Jun 2011 15:59:17 +1200 Subject: Try not to hang when user views large request & response bodies Two different strategies here: - Use a simple heuristic to detect if we're looking at XML data when indent mode is used. On non-XML data we can hang even on small documents. - Only view partial data for large bodies. At the moment the cutoff is 100k. I might finetune this later. --- test/test_utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/test_utils.py b/test/test_utils.py index 874b2c6f..6aefd403 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -18,6 +18,13 @@ class uisBin(libpry.AutoTree): assert utils.isBin("testing\x7f") +class uisXML(libpry.AutoTree): + def test_simple(self): + assert not utils.isXML("foo") + assert utils.isXML("