Proper return of a 404 response code.

This commit is contained in:
Alexander Andreev 2021-06-09 23:20:49 +04:00
parent 4a71bfc021
commit 83b3de284c
Signed by: Arav
GPG Key ID: 610DF2574456329F

View File

@ -147,6 +147,7 @@ app
await next(); await next();
if (ctx.status === 404) ctx.throw(404); if (ctx.status === 404) ctx.throw(404);
} catch (err) { } catch (err) {
ctx.status = err.status || 500;
if (ctx.status === 404) if (ctx.status === 404)
await ctx.render('404'); await ctx.render('404');
else else