Crawler Detection in Cloudflare Worker
Can we revisit this? Any way to detect IF crawler using cloudflare worker on PRO plan?
![](https://utfs.io/f/9caff53b-9832-4316-968a-473222dade2d-r42zcu.49.46_AM.png)
24 Replies
Thanks for any help 🙂
![](https://utfs.io/f/95d871a9-d117-466a-b727-e022d6f46b24-1nq2cb.png)
Transform Rule -> Modify Request Header -> this -> Read
X-Verified-Bot
header in your WorkerThis is done
![](https://utfs.io/f/b14e68a4-7ae9-4ce5-ad2e-d10f20390e29-jqwfow.04.14_PM.png)
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')
bot
is just true
or false
REVISED:
const bot = req.headers.get('X-Verified-Bot');
if bot == true {
you win
}
@kiannh
cf.client.bot
isn't pro?Anyone can have it
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
tooAvailable fields and functions for HTTP request header modification...
The available fields when setting an HTTP request header value using an expression are the following:
See if any of those sound interesting for your use-case
Of course,
cf.bot_management.*
is Enterprisehang on, why can't we use botManagement?
erm I mean
req.cf.botManagement.verifiedBot
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
![](https://utfs.io/f/bedd3421-4b00-4d8c-aeba-4b9699fef027-1nq2cb.png)