Merge branch 'relay-fu' into 'main'
relay: give a nice "fuck you" to clients sending invalid filters See merge request soapbox-pub/ditto!341
This commit is contained in:
commit
b62b5d7020
|
@ -63,8 +63,14 @@ function connectStream(socket: WebSocket) {
|
||||||
const store = await Storages.db();
|
const store = await Storages.db();
|
||||||
const pubsub = await Storages.pubsub();
|
const pubsub = await Storages.pubsub();
|
||||||
|
|
||||||
for (const event of await store.query(filters, { limit: FILTER_LIMIT })) {
|
try {
|
||||||
send(['EVENT', subId, event]);
|
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]);
|
send(['EOSE', subId]);
|
||||||
|
|
Loading…
Reference in New Issue