mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
Added check for bots.
This commit is contained in:
parent
ff9d4f8585
commit
943c2c73d4
3 changed files with 12 additions and 1 deletions
|
|
@ -1,8 +1,13 @@
|
|||
import { savePageView, saveEvent } from 'lib/queries';
|
||||
import { useCors, useSession } from 'lib/middleware';
|
||||
import { ok, badRequest } from 'lib/response';
|
||||
import isBot from 'isbot-fast';
|
||||
|
||||
export default async (req, res) => {
|
||||
if (isBot(req.headers['user-agent'])) {
|
||||
return ok(res);
|
||||
}
|
||||
|
||||
await useCors(req, res);
|
||||
await useSession(req, res);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue