mirror of
https://github.com/docusealco/docuseal
synced 2026-11-09 15:42:32 -05:00
block search bots
This commit is contained in:
1 parent
621431166b
commit
dbf446efe1
3 files changed
+55
No files matched your search
@@ -63,6 +63,42 @@ module DetectBrowserDevice
|
||||
NetBSD
|
||||
/ix
|
||||
|
||||
SEARCH_BOT_USER_AGENT_REGEXP = /
|
||||
Googlebot |
|
||||
Google-InspectionTool|
|
||||
Storebot-Google |
|
||||
AdsBot-Google |
|
||||
Mediapartners-Google |
|
||||
bingbot |
|
||||
BingPreview |
|
||||
adidxbot |
|
||||
msnbot |
|
||||
Slurp |
|
||||
DuckDuckBot |
|
||||
Baiduspider |
|
||||
YandexBot |
|
||||
YandexImages |
|
||||
Applebot |
|
||||
PetalBot |
|
||||
SeznamBot |
|
||||
Sogou |
|
||||
Exabot |
|
||||
Qwantify |
|
||||
YisouSpider |
|
||||
Bytespider |
|
||||
AhrefsBot |
|
||||
SemrushBot |
|
||||
MJ12bot |
|
||||
DotBot |
|
||||
GPTBot |
|
||||
OAI-SearchBot |
|
||||
ClaudeBot |
|
||||
Claude-SearchBot |
|
||||
PerplexityBot |
|
||||
CCBot |
|
||||
Amazonbot
|
||||
/ix
|
||||
|
||||
SDK_USER_AGENT_REGEXP = /\ADocuSeal (?<sdk>Ruby|Python|PHP|Java|C#|JS|Go|CLI) v/i
|
||||
|
||||
def call(user_agent)
|
||||
@@ -74,6 +110,10 @@ module DetectBrowserDevice
|
||||
'desktop'
|
||||
end
|
||||
|
||||
def search_bot?(user_agent)
|
||||
SEARCH_BOT_USER_AGENT_REGEXP.match?(user_agent.to_s)
|
||||
end
|
||||
|
||||
def os(user_agent)
|
||||
return if user_agent.blank?
|
||||
|
||||
|
||||
Reference in new issue
Block a user