From 31d02421e437679b15af2efc2d375689d91342cf Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Tue, 27 Dec 2022 21:42:32 +0100 Subject: [PATCH] fix: strip line break in message validity check (#11) --- nostr/relay.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nostr/relay.py b/nostr/relay.py index e118229..9ccb77b 100644 --- a/nostr/relay.py +++ b/nostr/relay.py @@ -80,6 +80,7 @@ class Relay: pass def _is_valid_message(self, message: str) -> bool: + message = message.strip("\n") if not message or message[0] != '[' or message[-1] != ']': return False