set downloadMetadata.status to 404 on unfound downloads. fixes #1501

Co-authored-by: timvisee <tim@visee.me>
This commit is contained in:
Danny Coates 2020-07-31 09:36:03 -07:00 committed by timvisee
parent 239fba452a
commit 28c48f51d1
No known key found for this signature in database
GPG key ID: B8DB720BC383E172
2 changed files with 15 additions and 2 deletions

View file

@ -56,6 +56,15 @@ module.exports = {
notfound: async function(req, res) {
const appState = await state(req);
res.status(404).send(stripEvents(routes().toString('/404', appState)));
res
.status(404)
.send(
stripEvents(
routes().toString(
'/404',
Object.assign(appState, { downloadMetadata: { status: 404 } })
)
)
);
}
};