From 2f602ea4e63e71d4c6c9add1d1816eee62e895a1 Mon Sep 17 00:00:00 2001 From: John Kevin Umali <54800909+Kevin-Umali@users.noreply.github.com> Date: Mon, 1 Jan 2024 23:56:35 +0800 Subject: [PATCH] [TL-DYS-68] v2 (#73) * TL-DYS-63 * Bugfix category and difficulty url state * Fix isbot error * Fix import of isbot --- server/src/middleware/useragent-parser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/middleware/useragent-parser.ts b/server/src/middleware/useragent-parser.ts index 559a040..22169c0 100644 --- a/server/src/middleware/useragent-parser.ts +++ b/server/src/middleware/useragent-parser.ts @@ -1,6 +1,6 @@ import { Request, Response, NextFunction } from "express"; import UAParser from "ua-parser-js"; -import isBot from "isbot"; +import { isbot } from "isbot"; const userAgentMiddleware = (req: Request, res: Response, next: NextFunction) => { const userAgentString = req.headers["user-agent"] ?? ""; @@ -12,7 +12,7 @@ const userAgentMiddleware = (req: Request, res: Response, next: NextFunction) => req.useragent = { isMobile: deviceType === "mobile", isDesktop: deviceType === undefined || !["wearable", "mobile"].includes(deviceType), - isBot: isBot.isbot(userAgentString), + isBot: isbot(userAgentString), browser: result.browser.name ?? "Unknown", version: result.browser.version ?? "Unknown", os: result.os.name ?? "Unknown",