aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/utils.py')
-rw-r--r--libmproxy/utils.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/libmproxy/utils.py b/libmproxy/utils.py
index 209ec27a..6c9f3288 100644
--- a/libmproxy/utils.py
+++ b/libmproxy/utils.py
@@ -44,6 +44,16 @@ def isBin(s):
return False
+def isXML(s):
+ for i in s:
+ if i in "\n \t":
+ continue
+ elif i == "<":
+ return True
+ else:
+ return False
+
+
def cleanBin(s):
parts = []
for i in s:
@@ -51,7 +61,8 @@ def cleanBin(s):
if o > 31 and o < 127:
parts.append(i)
else:
- parts.append(".")
+ if i not in "\n\r\t":
+ parts.append(".")
return "".join(parts)