From 85a4797e689d2f4a41a6530594c9555f46d32faf Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Wed, 24 Jan 2024 19:24:27 -0500 Subject: [PATCH] make sure bool(Response) returns True --- relay/misc.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/relay/misc.py b/relay/misc.py index a03700d..d7e96d8 100644 --- a/relay/misc.py +++ b/relay/misc.py @@ -180,6 +180,11 @@ class Message(ApMessage): class Response(AiohttpResponse): + # AiohttpResponse.__len__ method returns 0, so bool(response) always returns False + def __bool__(self) -> bool: + return True + + @classmethod def new(cls: type[Response], body: str | bytes | dict = '',