mirror of
https://github.com/Cameri/nostream.git
synced 2025-04-09 20:29:07 +02:00
chore: enforce event kind limits
This commit is contained in:
parent
54ece3641b
commit
45fe91ae66
@ -79,5 +79,17 @@ export class EventMessageHandler implements IMessageHandler {
|
||||
return `insufficient proof of work: pubkey has less than ${limits.pubkey.minLeadingZeroBits} leading zero bits`
|
||||
}
|
||||
}
|
||||
|
||||
if (limits.kind.blacklist.length > 0) {
|
||||
if (limits.kind.blacklist.includes(event.kind)) {
|
||||
return `event kind ${event.kind} is not allowed`
|
||||
}
|
||||
}
|
||||
|
||||
if (limits.kind.whitelist.length > 0) {
|
||||
if (!limits.kind.whitelist.includes(event.kind)) {
|
||||
return `event kind ${event.kind} is not allowed`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user