diff --git a/gunicorn/http/parser.py b/gunicorn/http/parser.py index 5b2da115..260beafa 100644 --- a/gunicorn/http/parser.py +++ b/gunicorn/http/parser.py @@ -36,9 +36,9 @@ class Parser: """ if self.mesg: try: - data = self.mesg.body.read(8192) + data = self.mesg.body.read(1024) while data: - data = self.mesg.body.read(8192) + data = self.mesg.body.read(1024) except ssl.SSLWantReadError: # SSL socket has no more application data available pass diff --git a/tests/test_gthread.py b/tests/test_gthread.py index a085ada7..0762cc99 100644 --- a/tests/test_gthread.py +++ b/tests/test_gthread.py @@ -1443,7 +1443,7 @@ class TestFinishBodySSL: parser.finish_body() # Should not raise # Verify body.read was called - mock_body.read.assert_called_once_with(8192) + mock_body.read.assert_called_once_with(1024) def test_finish_body_reads_all_data_before_ssl_error(self): """Test that finish_body() reads all available data before SSLWantReadError.""" @@ -1513,4 +1513,4 @@ class TestFinishBodySSL: parser.finish_body() # Verify body.read was called once and returned empty - mock_body.read.assert_called_once_with(8192) + mock_body.read.assert_called_once_with(1024)