Fix Googlebot detection
This commit is contained in:
parent
ce16fd4b36
commit
dba1d368a0
@ -72,10 +72,10 @@ def ingress_request(
|
|||||||
ua = user_agents.parse(user_agent)
|
ua = user_agents.parse(user_agent)
|
||||||
initial = True
|
initial = True
|
||||||
device_type = "OTHER"
|
device_type = "OTHER"
|
||||||
if ua.is_mobile:
|
if ua.is_bot or (ua.browser.family or "").strip() == "Googlebot":
|
||||||
device_type = "PHONE"
|
|
||||||
elif ua.is_bot or (ua.browser.family or "").strip() == "Googlebot":
|
|
||||||
device_type = "ROBOT"
|
device_type = "ROBOT"
|
||||||
|
elif ua.is_mobile:
|
||||||
|
device_type = "PHONE"
|
||||||
elif ua.is_tablet:
|
elif ua.is_tablet:
|
||||||
device_type = "TABLET"
|
device_type = "TABLET"
|
||||||
elif ua.is_pc:
|
elif ua.is_pc:
|
||||||
|
Loading…
Reference in New Issue
Block a user