From 3e4d5c26333c229248a0962b33e8ffdf86959e8b Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Mon, 2 Sep 2024 19:56:57 +1000 Subject: [PATCH] fix: Use header.get instead of user agent --- server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 7b60d08..d7e16ae 100644 --- a/server.py +++ b/server.py @@ -342,8 +342,8 @@ def index(): # Check if crawler if ( - "Googlebot" not in request.user_agent.browser - and "Bingbot" not in request.user_agent.browser + "Googlebot" not in request.headers.get("User-Agent") + and "Bingbot" not in request.headers.get("User-Agent") ): # Check if cookie is set if not request.cookies.get("loaded") and not loaded: