aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy
diff options
context:
space:
mode:
authorHenrique <typoon@gmail.com>2019-11-12 21:44:07 -0500
committerHenrique <typoon@gmail.com>2019-11-12 21:44:07 -0500
commita9596cabe34b07ac45df644c00d57bf1116b8c3e (patch)
treec99ef1ad9b58f437e9c2c0ff0a2fd811b671a260 /mitmproxy
parent561415cea99c46dd5df892bcac148931f70ff3b0 (diff)
downloadmitmproxy-a9596cabe34b07ac45df644c00d57bf1116b8c3e.tar.gz
mitmproxy-a9596cabe34b07ac45df644c00d57bf1116b8c3e.tar.bz2
mitmproxy-a9596cabe34b07ac45df644c00d57bf1116b8c3e.zip
Small fix to handle line breaks and tabs \r\n\t
Diffstat (limited to 'mitmproxy')
-rw-r--r--mitmproxy/lexer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mitmproxy/lexer.py b/mitmproxy/lexer.py
index 5187a718..31ae382c 100644
--- a/mitmproxy/lexer.py
+++ b/mitmproxy/lexer.py
@@ -69,6 +69,8 @@ class Lexer:
text = self.text
i = 0
+ whitespace = "\r\n\t "
+
#self.text.seek(self._text_pos)
while True:
@@ -98,7 +100,7 @@ class Lexer:
self._state = self._states.pop()
elif self._state == State.TEXT:
- if ch == ' ':
+ if ch in whitespace:
if acc != '':
break
elif ch == '"' or ch == "'":
@@ -141,6 +143,7 @@ if __name__ == '__main__':
cases.append(r' ')
cases.append(r' ')
cases.append(r'Hello World ')
+ cases.append('\n\n\rHello\n World With Spaces\n\n')
for s in cases:
lex = Lexer(s)