Fix missing return values in streaming (#26233)

pull/2339/head
Renaud Chaput 2023-07-28 19:11:58 +02:00 committed by GitHub
parent 446821a0dc
commit 3554c52795
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -786,12 +786,12 @@ const startServer = async () => {
const filter_results = Object.values(req.cachedFilters).reduce((results, cachedFilter) => {
// Check the filter hasn't expired before applying:
if (cachedFilter.expires_at !== null && cachedFilter.expires_at < now) {
return;
return results;
}
// Just in-case JSDOM fails to find textContent in searchableContent
if (!searchableTextContent) {
return;
return results;
}
const keyword_matches = searchableTextContent.match(cachedFilter.regexp);
@ -806,6 +806,8 @@ const startServer = async () => {
status_matches: null
});
}
return results;
}, []);
// Send the payload + the FilterResults as the `filtered` property