Crawler Detection in Cloudflare Worker

Can we revisit this? Any way to detect IF crawler using cloudflare worker on PRO plan?
24 Replies
Retard
Retard•2y ago
Thanks for any help 🙂
kian
kian•2y ago
kian
kian•2y ago
Transform Rule -> Modify Request Header -> this -> Read X-Verified-Bot header in your Worker
Retard
Retard•2y ago
This is done
Retard
Retard•2y ago
Can you please assist with Bot Level Code? Simple as this? const bot = req.headers.get('X-Verified-Bot'); if bot = ('Bot1|Bot2|Bot3|Bot4')
kian
kian•2y ago
bot is just true or false
Retard
Retard•2y ago
REVISED: const bot = req.headers.get('X-Verified-Bot'); if bot == true { you win } @kiannh
dave
dave•2y ago
cf.client.bot isn't pro?
kian
kian•2y ago
Anyone can have it
dave
dave•2y ago
interesting, any other headers you know of that are helpful to pass in like that? Currently I pass in the timestamp, gonna add X-Verified-Bot too
kian
kian•2y ago
See if any of those sound interesting for your use-case Of course, cf.bot_management.* is Enterprise
dave
dave•2y ago
hang on, why can't we use botManagement? erm I mean req.cf.botManagement.verifiedBot
kian
kian•2y ago
because that's an Enterprise add-on if you mean it's available to you right now when you're not on an Enterprise plan, don't rely on that staying
dave
dave•2y ago
Want results from more Discord servers?
Add your server