diff --git a/stapler/handlers.py b/stapler/handlers.py index 40456c4..dbedbdf 100644 --- a/stapler/handlers.py +++ b/stapler/handlers.py @@ -39,6 +39,8 @@ class BaseHandler(abc.ABC, http.server.BaseHTTPRequestHandler): self.__in_size: int | None = None self.https: bool = params.https super().__init__(*args, **kwargs) + with contextlib.suppress(Exception): + self.connection.close() @typing.override def send_error(