mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-24 23:41:09 +00:00
make sure bool(Response) returns True
This commit is contained in:
parent
c2aa8c48bb
commit
85a4797e68
|
@ -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 = '',
|
||||
|
|
Loading…
Reference in a new issue