diff --git a/libmproxy/console.py b/libmproxy/console.py index fb1a2ed07..3e00249d9 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() diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py index 32057c249..9b21bd22b 100644 --- a/libmproxy/proxy.py +++ b/libmproxy/proxy.py @@ -122,7 +122,7 @@ def parse_request_line(request): if major != 1: raise ProxyError(400, "Unsupported protocol") return method, scheme, host, port, path, minor - + class FileLike: def __init__(self, o): diff --git a/libmproxy/utils.py b/libmproxy/utils.py index a7e41752d..108a99cbe 100644 --- a/libmproxy/utils.py +++ b/libmproxy/utils.py @@ -413,7 +413,7 @@ def parse_url(url): def parse_size(s): """ Parses a size specification. Valid specifications are: - + 123: bytes 123k: kilobytes 123m: megabytes @@ -437,6 +437,3 @@ def parse_size(s): return int(s) * mult except ValueError: raise ValueError("Invalid size specification: %s"%s) - - - diff --git a/test/serv.py b/test/serv.py index 53747f08d..f6dee2cc6 100644 --- a/test/serv.py +++ b/test/serv.py @@ -4,7 +4,5 @@ from BaseHTTPServer import HTTPServer import handler def make(port): - server_address = ('', port) + server_address = ('127.0.0.1', port) return HTTPServer(server_address, handler.TestRequestHandler) - - diff --git a/test/sslserv.py b/test/sslserv.py index 4aa4df398..557ce8697 100644 --- a/test/sslserv.py +++ b/test/sslserv.py @@ -18,5 +18,5 @@ class SecureHTTPServer(HTTPServer): def make(port): - server_address = ('', port) + server_address = ('127.0.0.1', port) return SecureHTTPServer(server_address, handler.TestRequestHandler) diff --git a/test/test_server.py b/test/test_server.py index 1e3c1df49..b000cc463 100644 --- a/test/test_server.py +++ b/test/test_server.py @@ -41,7 +41,7 @@ class uProxy(tutils.ProxTest): assert f.code == 200 assert f.read() f.close() - + l = self.log() assert l[0].address assert "host" in l[1].headers