diff --git a/examples/test_context.py b/examples/test_context.py index 7c0386c1f..1f0a7f8b0 100644 --- a/examples/test_context.py +++ b/examples/test_context.py @@ -16,7 +16,7 @@ def test_simple(): # Check the returned data assert r.status_code == 200 - assert len(r.content) == 100 + assert len(r.body) == 100 # Check pathod's internal log log = d.last_log()["request"] diff --git a/examples/test_setup.py b/examples/test_setup.py index 39bd96b9c..c6e52d00b 100644 --- a/examples/test_setup.py +++ b/examples/test_setup.py @@ -24,7 +24,7 @@ class Test: # Check the returned data assert r.status_code == 200 - assert len(r.content) == 100 + assert len(r.body) == 100 # Check pathod's internal log log = self.d.last_log()["request"] diff --git a/examples/test_setupall.py b/examples/test_setupall.py index 631caa761..ddf4d9055 100644 --- a/examples/test_setupall.py +++ b/examples/test_setupall.py @@ -29,7 +29,7 @@ class Test: # Check the returned data assert r.status_code == 200 - assert len(r.content) == 100 + assert len(r.body) == 100 # Check pathod's internal log log = self.d.last_log()["request"] diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py index c1bca07f4..e93e6208d 100644 --- a/libpathod/pathoc.py +++ b/libpathod/pathoc.py @@ -417,7 +417,7 @@ class Pathoc(tcp.TCPClient): finally: if resp: lg("<< %s %s: %s bytes" % ( - resp.status_code, utils.xrepr(resp.msg), len(resp.content) + resp.status_code, utils.xrepr(resp.msg), len(resp.body) )) if resp.status_code in self.ignorecodes: lg.suppress() diff --git a/libpathod/pathod.py b/libpathod/pathod.py index f8607cca5..6f25d0c8c 100644 --- a/libpathod/pathod.py +++ b/libpathod/pathod.py @@ -212,7 +212,7 @@ class PathodHandler(tcp.BaseHandler): spec = anchor_gen.next() if self.use_http2 and isinstance(spec, language.http2.Response): - spec.stream_id = stream_id + spec.stream_id = req.stream_id lg("crafting spec: %s" % spec) nexthandler, retlog["response"] = self.http_serve_crafted( diff --git a/libpathod/protocols/http.py b/libpathod/protocols/http.py index 43ef07994..d60178829 100644 --- a/libpathod/protocols/http.py +++ b/libpathod/protocols/http.py @@ -13,7 +13,7 @@ class HTTPProtocol: def make_error_response(self, reason, body): return language.http.make_error_response(reason, body) - def handle_http_app(self, method, path, headers, content, lg): + def handle_http_app(self, method, path, headers, body, lg): """ Handle a request to the built-in app. """ @@ -25,7 +25,7 @@ class HTTPProtocol: msg="Access denied: web interface disabled" ) lg("app: %s %s" % (method, path)) - req = wsgi.Request("http", method, path, headers, content) + req = wsgi.Request("http", method, path, headers, body) flow = wsgi.Flow(self.pathod_handler.address, req) sn = self.pathod_handler.connection.getsockname() a = wsgi.WSGIAdaptor( diff --git a/test/test_app.py b/test/test_app.py index 4536db8e7..4571617ff 100644 --- a/test/test_app.py +++ b/test/test_app.py @@ -7,7 +7,7 @@ class TestApp(tutils.DaemonTests): def test_index(self): r = self.getpath("/") assert r.status_code == 200 - assert r.content + assert r.body def test_about(self): r = self.getpath("/about") @@ -38,48 +38,48 @@ class TestApp(tutils.DaemonTests): def test_response_preview(self): r = self.getpath("/response_preview", params=dict(spec="200")) assert r.status_code == 200 - assert 'Response' in r.content + assert 'Response' in r.body r = self.getpath("/response_preview", params=dict(spec="foo")) assert r.status_code == 200 - assert 'Error' in r.content + assert 'Error' in r.body r = self.getpath("/response_preview", params=dict(spec="200:b@100m")) assert r.status_code == 200 - assert "too large" in r.content + assert "too large" in r.body r = self.getpath("/response_preview", params=dict(spec="200:b@5k")) assert r.status_code == 200 - assert 'Response' in r.content + assert 'Response' in r.body r = self.getpath( "/response_preview", params=dict( spec="200:b