Updated bot detection library.

This commit is contained in:
Mike Cao 2021-03-12 22:44:25 -08:00
parent e5ff182302
commit fb711d58f1
3 changed files with 8 additions and 8 deletions

View File

@ -71,7 +71,7 @@
"formik": "^2.2.6", "formik": "^2.2.6",
"immer": "^8.0.1", "immer": "^8.0.1",
"is-localhost-ip": "^1.4.0", "is-localhost-ip": "^1.4.0",
"isbot-fast": "^1.2.0", "isbot": "^3.0.25",
"jose": "2.0.3", "jose": "2.0.3",
"maxmind": "^4.3.1", "maxmind": "^4.3.1",
"moment-timezone": "^0.5.32", "moment-timezone": "^0.5.32",

View File

@ -1,14 +1,14 @@
import isBot from 'isbot-fast'; import isbot from 'isbot';
import { savePageView, saveEvent } from 'lib/queries'; import { savePageView, saveEvent } from 'lib/queries';
import { useCors, useSession } from 'lib/middleware'; import { useCors, useSession } from 'lib/middleware';
import { getIpAddress } from 'lib/request';
import { ok, badRequest } from 'lib/response'; import { ok, badRequest } from 'lib/response';
import { createToken } from 'lib/crypto'; import { createToken } from 'lib/crypto';
import { getIpAddress } from '../../lib/request';
export default async (req, res) => { export default async (req, res) => {
await useCors(req, res); await useCors(req, res);
if (isBot(req.headers['user-agent'])) { if (isbot(req.headers['user-agent'])) {
return ok(res); return ok(res);
} }

View File

@ -4414,10 +4414,10 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
isbot-fast@^1.2.0: isbot@^3.0.25:
version "1.2.0" version "3.0.25"
resolved "https://registry.yarnpkg.com/isbot-fast/-/isbot-fast-1.2.0.tgz#ef0ef1d5db34eb60777250ae26fceb72b94153e2" resolved "https://registry.yarnpkg.com/isbot/-/isbot-3.0.25.tgz#56c9fe4134016ae84204738b59c0364e7a801f7c"
integrity sha512-twjuQzy2gKMDVfKGQyQqrx6Uy4opu/fiVUTTpdqtFsd7OQijIp5oXvb27n5EemYXaijh5fomndJt/SPRLsEdSg== integrity sha512-8mLxO0arSU+JYfcJBbwROCzVhqAdqJSMmsyMDVj4dd7enEevjrNCXjoG0oSkIfZ4icPHuxocO1z3k1oDoI/rbw==
isexe@^2.0.0: isexe@^2.0.0:
version "2.0.0" version "2.0.0"