mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -08:00
fix(core): Ignore missing user-agent on bot check (no-changelog) (#7153)
This commit is contained in:
parent
6e5a4f6a58
commit
22edc03cab
|
@ -201,7 +201,7 @@ export abstract class AbstractServer {
|
||||||
const checkIfBot = isbot.spawn(['bot']);
|
const checkIfBot = isbot.spawn(['bot']);
|
||||||
this.app.use((req, res, next) => {
|
this.app.use((req, res, next) => {
|
||||||
const userAgent = req.headers['user-agent'];
|
const userAgent = req.headers['user-agent'];
|
||||||
if (!userAgent || checkIfBot(userAgent)) {
|
if (userAgent && checkIfBot(userAgent)) {
|
||||||
Logger.info(`Blocked ${req.method} ${req.url} for "${userAgent}"`);
|
Logger.info(`Blocked ${req.method} ${req.url} for "${userAgent}"`);
|
||||||
res.status(204).end();
|
res.status(204).end();
|
||||||
} else next();
|
} else next();
|
||||||
|
|
Loading…
Reference in a new issue