From e54859a6f3758fd936b740047f541c866508170c Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Sun, 31 Jan 2016 16:08:37 +0000 Subject: [PATCH 1/3] Update proxy script for latest mitmproxy --- tests/utils/proxy/proxy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utils/proxy/proxy.py b/tests/utils/proxy/proxy.py index 502c1d91f..4f252388c 100755 --- a/tests/utils/proxy/proxy.py +++ b/tests/utils/proxy/proxy.py @@ -1,5 +1,5 @@ def request(context, flow): - flow.request.headers["x-requests-proxy"] = ["http"] + flow.request.headers["x-requests-proxy"] = "http" def response(context, flow): - flow.response.headers["x-requests-proxied"] = ["http"] \ No newline at end of file + flow.response.headers[b"x-requests-proxied"] = "http" \ No newline at end of file From cddda9aeb5b7a2da50cd145dcc91b8239af30686 Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Sun, 31 Jan 2016 16:15:52 +0000 Subject: [PATCH 2/3] Fix mitmproxy to 0.15 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 707700321..07252b625 100755 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ install: - phpenv local --unset # Setup the proxy - - pip install --user mitmproxy + - pip install --user mitmproxy~=0.15 before_script: - PHPBIN=$TESTPHPBIN PORT=8080 vendor/bin/start.sh From 72baaa0c371b5f76ea3892c59f3e83030a71c0e4 Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Sun, 31 Jan 2016 16:30:33 +0000 Subject: [PATCH 3/3] Switch TRACE and OPTIONS to the correct endpoints --- tests/Transport/Base.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Transport/Base.php b/tests/Transport/Base.php index c1f30f3fa..2a1127069 100755 --- a/tests/Transport/Base.php +++ b/tests/Transport/Base.php @@ -132,7 +132,7 @@ public function testHEAD() { } public function testTRACE() { - $request = Requests::trace(httpbin('/get'), array(), $this->getOptions()); + $request = Requests::trace(httpbin('/trace'), array(), $this->getOptions()); $this->assertEquals(200, $request->status_code); } @@ -242,7 +242,7 @@ public function testPATCHWithArray() { } public function testOPTIONS() { - $request = Requests::options(httpbin('/post'), array(), array(), $this->getOptions()); + $request = Requests::options(httpbin('/options'), array(), array(), $this->getOptions()); $this->assertEquals(200, $request->status_code); }