mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-17 21:32:55 +01:00
do not give away so much.
This commit is contained in:
parent
27d6769009
commit
5efadf6256
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user