Proper return of a 404 response code.
This commit is contained in:
parent
4a71bfc021
commit
83b3de284c
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user