mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-22 06:27:59 +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):
|
class Response(AiohttpResponse):
|
||||||
|
# AiohttpResponse.__len__ method returns 0, so bool(response) always returns False
|
||||||
|
def __bool__(self) -> bool:
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def new(cls: type[Response],
|
def new(cls: type[Response],
|
||||||
body: str | bytes | dict = '',
|
body: str | bytes | dict = '',
|
||||||
|
|
Loading…
Reference in a new issue