Skip to content

Commit c5d3701

Browse files
authored
Merge pull request #535 from devforth/feature/AdminForth/1302/express-server--when-file-is-n
fix: don't log an error message, if somebody tries to accses file, t…
2 parents fefdf74 + ac05398 commit c5d3701

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

adminforth/servers/express.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ class ExpressServer implements IExpressHttpServer {
136136
'Pragma': 'public',
137137
}
138138
}
139-
)
139+
, (err) => {
140+
if (err && err.message.includes('ENOENT')) {
141+
res.status(404).send('Not found');
142+
}
143+
});
140144
})
141145

142146
this.expressApp.get(`${prefix}*`, async (req, res) => {

0 commit comments

Comments
 (0)