fix: dont log BrokenPipeError and ConnectionResetError

This commit is contained in:
2026-05-06 09:36:31 +02:00
parent f77e826490
commit 8c93b9a015
2 changed files with 17 additions and 0 deletions
+15
View File
@@ -177,6 +177,21 @@ class TestRequestHandler(BaseHandlerTestCase):
token_manager=self.token_manager,
)
def test_handle_disconnect_silently(self) -> None:
with self.patch("http.server.BaseHTTPRequestHandler.__init__") as mock:
mock.side_effect = BrokenPipeError
logging.basicConfig(level=logging.CRITICAL)
RequestHandler(
unittest.mock.MagicMock(),
"127.0.0.1",
unittest.mock.MagicMock(),
params=Parameters(
data_dir=self.get_tmp_dir(), certbot_www=str(self.certbot_www)
),
registry=self.registry,
token_manager=self.token_manager,
)
def test_do_head_forward(self) -> None:
handler = self._get_handler()
with (