From 5efadf6256abd83949590848e80b2e9a49d930af Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 29 Mar 2024 18:25:47 -0300 Subject: [PATCH] do not give away so much. --- policies/events.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/policies/events.go b/policies/events.go index 600d31e..7d8fd4c 100644 --- a/policies/events.go +++ b/policies/events.go @@ -78,7 +78,7 @@ func RestrictToSpecifiedKinds(kinds ...uint16) func(context.Context, *nostr.Even // these are cheap and very questionable optimizations, but they exist for a reason: // we would have to ensure that the kind number is within the bounds of a uint16 anyway if event.Kind > max { - return true, fmt.Sprintf("event kind not allowed (it should be lower than %)", max) + return true, fmt.Sprintf("event kind not allowed (it should be lower than %d)", max) } if event.Kind < min { return true, fmt.Sprintf("event kind not allowed (it should be higher than %d)", min) @@ -92,8 +92,7 @@ func RestrictToSpecifiedKinds(kinds ...uint16) func(context.Context, *nostr.Even return false, "" } - allowedKindsStringFormatted := fmt.Sprintf("%d\n", kinds) - return true, fmt.Sprintf("Received event kind %d not allowed, only allowed are: %s", event.Kind, allowedKindsStringFormatted) + return true, fmt.Sprintf("received event kind %d not allowed", event.Kind) } }