do not give away so much.

This commit is contained in:
fiatjaf 2024-03-29 18:25:47 -03:00
parent 27d6769009
commit 5efadf6256

View File

@ -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)
}
}