From 8855fd0b0152b706c06469b4b08200af4bf262a1 Mon Sep 17 00:00:00 2001 From: Klemek Date: Tue, 5 May 2026 15:09:20 +0200 Subject: [PATCH] fix: force connection close --- stapler/handlers.py | 2 ++ 1 file changed, 2 insertions(+) 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(