mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-18 22:14:23 +01:00
relay: give a nice "fuck you" to clients sending invalid filters
This commit is contained in:
@@ -63,8 +63,14 @@ function connectStream(socket: WebSocket) {
|
||||
const store = await Storages.db();
|
||||
const pubsub = await Storages.pubsub();
|
||||
|
||||
for (const event of await store.query(filters, { limit: FILTER_LIMIT })) {
|
||||
send(['EVENT', subId, event]);
|
||||
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]);
|
||||
|
||||
Reference in New Issue
Block a user