From 63ece45de528a41d4ca4e9eefbda731b2a225f9e Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 25 Aug 2013 03:45:32 +0200 Subject: [PATCH 1/6] add coveralls.io --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5f4a36020..cecfce12d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,12 @@ python: - "2.7" # command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors install: + - "pip install coveralls --use-mirrors" - "pip install -r requirements.txt --use-mirrors" - "pip install --upgrade git+https://github.com/mitmproxy/netlib.git" - "pip install --upgrade git+https://github.com/mitmproxy/pathod.git" # command to run tests, e.g. python setup.py test -script: nosetests \ No newline at end of file +script: + - "nosetests --with-cov --cov-report term-missing" +after_success: + - coveralls \ No newline at end of file From 08a26337a0f45ea24f0f118614c38ebd8e68b8b4 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 25 Aug 2013 03:53:19 +0200 Subject: [PATCH 2/6] re-add requirements.txt --- requirements.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..72b01ce76 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,15 @@ +Flask==0.9 +Jinja2==2.7 +MarkupSafe==0.18 +PIL==1.1.7 +Werkzeug==0.8.3 +lxml==3.2.1 +netlib==0.9.2 +nose==1.3.0 +pathod==0.9.2 +pyOpenSSL==0.13 +pyasn1==0.1.7 +requests==1.2.2 +urwid==1.1.1 +wsgiref==0.1.2 +jsbeautifier==1.4.0 \ No newline at end of file From 62fa2e6c07d66057984b33222069f14dfe856091 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 25 Aug 2013 04:03:53 +0200 Subject: [PATCH 3/6] fix travis, loose requirements.txt --- .travis.yml | 1 + requirements.txt | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index cecfce12d..c10843199 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ python: # command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors install: - "pip install coveralls --use-mirrors" + - "pip install nose-cov --use-mirrors" - "pip install -r requirements.txt --use-mirrors" - "pip install --upgrade git+https://github.com/mitmproxy/netlib.git" - "pip install --upgrade git+https://github.com/mitmproxy/pathod.git" diff --git a/requirements.txt b/requirements.txt index 72b01ce76..3ecd8ed4e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,15 @@ -Flask==0.9 -Jinja2==2.7 -MarkupSafe==0.18 -PIL==1.1.7 -Werkzeug==0.8.3 -lxml==3.2.1 -netlib==0.9.2 -nose==1.3.0 -pathod==0.9.2 -pyOpenSSL==0.13 -pyasn1==0.1.7 -requests==1.2.2 -urwid==1.1.1 -wsgiref==0.1.2 -jsbeautifier==1.4.0 \ No newline at end of file +Flask>=0.9 +Jinja2>=2.7 +MarkupSafe>=0.18 +PIL>=1.1.7 +Werkzeug>=0.8.3 +lxml>=3.2.1 +netlib>=0.9.2 +nose>=1.3.0 +pathod>=0.9.2 +pyOpenSSL>=0.13 +pyasn1>=0.1.7 +requests>=1.2.2 +urwid>=1.1.1 +wsgiref>=0.1.2 +jsbeautifier>=1.4.0 \ No newline at end of file From 404445cbdff3528b0b8b45a759e5b2f2c161ae2a Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 25 Aug 2013 04:19:43 +0200 Subject: [PATCH 4/6] exclude TestHTTPS for testing travis/coverage --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c10843199..61dfe73f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,6 @@ install: - "pip install --upgrade git+https://github.com/mitmproxy/pathod.git" # command to run tests, e.g. python setup.py test script: - - "nosetests --with-cov --cov-report term-missing" + - "nosetests -e TestHTTPS --with-cov --cov-report term-missing" after_success: - coveralls \ No newline at end of file From 38a1135ab8f3ab2e97d07fa8e339067c67722e16 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 25 Aug 2013 04:31:35 +0200 Subject: [PATCH 5/6] add status images to README, include TestHTTPS again --- .travis.yml | 2 +- README.mkd | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 61dfe73f0..c10843199 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,6 @@ install: - "pip install --upgrade git+https://github.com/mitmproxy/pathod.git" # command to run tests, e.g. python setup.py test script: - - "nosetests -e TestHTTPS --with-cov --cov-report term-missing" + - "nosetests --with-cov --cov-report term-missing" after_success: - coveralls \ No newline at end of file diff --git a/README.mkd b/README.mkd index 8f564d7ff..35b41413d 100644 --- a/README.mkd +++ b/README.mkd @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/mitmproxy/mitmproxy.png)](https://travis-ci.org/mitmproxy/mitmproxy) [![Coverage Status](https://coveralls.io/repos/mitmproxy/mitmproxy/badge.png)](https://coveralls.io/r/mitmproxy/mitmproxy) + __mitmproxy__ is an interactive, SSL-capable man-in-the-middle proxy for HTTP with a console interface. From d4c3b1c21355a46219c58e23d7542fa059af7573 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 19 Nov 2013 04:08:16 +0100 Subject: [PATCH 6/6] attempt to fix https://github.com/mitmproxy/netlib/issues/24 --- libmproxy/proxy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py index 75a541920..790ae18ad 100644 --- a/libmproxy/proxy.py +++ b/libmproxy/proxy.py @@ -258,13 +258,13 @@ class ProxyHandler(tcp.BaseHandler): else: response = response_reply self.send_response(response) - if request and http.request_connection_close(request.httpversion, request.headers): + if request and http.connection_close(request.httpversion, request.headers): return # We could keep the client connection when the server # connection needs to go away. However, we want to mimic # behaviour as closely as possible to the client, so we # disconnect. - if http.response_connection_close(response.httpversion, response.headers): + if http.connection_close(response.httpversion, response.headers): return except (IOError, ProxyError, http.HttpError, tcp.NetLibError), e: if hasattr(e, "code"):