3 ms·
> (I assume the Worker was requesting the Readme site using the Googlebot user agent but with whatever IP address is used when using CF Workers). Regardless of
by judge2020 4y ago
> (I assume the Worker was requesting the Readme site using the Googlebot user agent but with whatever IP address is used when using CF Workers).
Regardless of using Workers or not, Cloudflare requests URLs with the header `cf-connecting-ip` and `x-forwarded-for` set to the actual client's IP address, and the website behind CF should be using this header to get source IPs.
- kentonv 4y agoThat's not true when you're sending a request to a site belonging to a different Cloudflare account. In that case, the headers are set to a non-routable placeholder IP address used to represent Workers itself. Passing through the original client IP in this case would be a security flaw because the Worker could have arbitrarily rewritten the request, so it can no longer be considered to have come from that client.
- judge2020 4y agoAh indeed, I hadn't picked up on the use-case being requesting a third-party site from a worker on their site. In that case, the solution would be to add code to rewrite the incoming googlebot user agent to something nondescript for these calls.