relay: give a nice "fuck you" to clients sending invalid filters
This commit is contained in:
parent
5ca1e2fd26
commit
761143a317
|
@ -63,9 +63,15 @@ function connectStream(socket: WebSocket) {
|
|||
const store = await Storages.db();
|
||||
const pubsub = await Storages.pubsub();
|
||||
|
||||
try {
|
||||
for (const event of await store.query(filters, { limit: FILTER_LIMIT })) {
|
||||
send(['EVENT', subId, event]);
|
||||
}
|
||||
} catch (e) {
|
||||
send(['CLOSED', subId, e.message]);
|
||||
controllers.delete(subId);
|
||||
return;
|
||||
}
|
||||
|
||||
send(['EOSE', subId]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue