From d5e3722c97c2094032fe02095c3b8f7cb4df87c3 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 21 Jan 2012 12:43:00 +1300 Subject: Fix an issue caused by some editors when editing a request/response body. Many editors make it hard save a file without a terminating newline on the last line. When editing message bodies, this can cause problems. For now, I just strip the newlines off the end of the body when we return from an editor. --- libmproxy/console.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libmproxy/console.py') diff --git a/libmproxy/console.py b/libmproxy/console.py index fb1a2ed0..3e00249d 100644 --- a/libmproxy/console.py +++ b/libmproxy/console.py @@ -454,7 +454,8 @@ class ConnectionView(WWrap): self.flow.backup() if part == "b": - conn.content = self._spawn_editor(conn.content or "") + c = self._spawn_editor(conn.content or "") + conn.content = c.rstrip("\n") elif part == "h": headertext = self._spawn_editor(repr(conn.headers)) headers = flow.Headers() -- cgit v1.2.3