mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: also ignore notfound error redirects
This commit is contained in:
1 parent
cccc6bd156
commit
03d096dc79
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.33.0",
|
||||
"version": "2.33.1",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -651,7 +651,7 @@ export class Handler extends HandlerCommon {
|
||||
logger.error(`User: ${this.user._id}(${this.user.uname}) Path: ${this.request.path}`, error.msg(), error.params);
|
||||
if (error.stack) logger.error(error.stack);
|
||||
}
|
||||
if (this.user?._id === 0 && !(error instanceof LoginError)) {
|
||||
if (this.user?._id === 0 && !(error instanceof LoginError) && !(error instanceof NotFoundError)) {
|
||||
this.response.redirect = this.url('user_login', { query: { redirect: this.request.path + this.ctx.search } });
|
||||
} else {
|
||||
this.response.status = error instanceof UserFacingError ? error.code : 500;
|
||||
|
||||
Reference in new issue
Block a user