DEV: Provide a safe agent in check_crawler_limits()

This commit is contained in:
Arkshine 2024-06-11 12:51:20 +02:00 committed by Régis Hanol
parent 30ae313dec
commit 29460e1422

View File

@ -460,7 +460,7 @@ class Middleware::RequestTracker
slow_down_agents = SiteSetting.slow_down_crawler_user_agents
return if slow_down_agents.blank?
user_agent = env["HTTP_USER_AGENT"]&.downcase
user_agent = HttpUserAgentEncoder.ensure_utf8(env["HTTP_USER_AGENT"])&.downcase
return if user_agent.blank?
return if !CrawlerDetection.crawler?(user_agent)