Missing CF-IPCountry header, but do have all other Visitor headers?

I’m noticing an odd issue with the “Add visitor location headers” Managed Transform rule.

For whatever reason, I’m getting the visitor headers I’d expect, as described here https://developers.cloudflare.com/rules/transform/managed-transforms/reference/#http-request-headers, but incoming requests are missing the cf-ipcountry header.

Note, I do have “IP Geolocation” enabled at the Network level.

Since I’m seeing cf-postal-code, cf-region, etc, I’m pretty stumped at the lack of cf-ipcountry. Any ideas? I’d appreciate any insight.

Here’s a dump of the incoming headers

   "cf-ipcity":"San Jose",
   "cdn-loop":"cloudflare; subreqs=1",
   "user-agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/ Safari/537.36"

Type the IP address in here:


The Country field may be missing.

1 Like

Thanks for the tip!

I plugged in the cf-connecting-ip of both my request and a co-worker’s located in Brazil, and they appear to be validly mapped:

So interestingly enough, I created a custom header modification (dynamic) that pulls from ip.src.country, which should be set as the cf-ipcountry header, and I now see my custom header with the country. Very odd! Happy this works, but still head-scratching.

   "cf-region":"Federal District",
   ...other visitor headers

Do you have any other Geo rules set? That’d be weird if your combination of Zone IP Geolocation setting and Mangaged transform were stepping on each other’s feet.

It sorta looks looks like this is going through a Worker. Any issues for requests not going through a Worker?

1 Like

Interesting; we do have more than one country-based WAF rule in effect. For the sake of testing, I’ll remove these in our staging workspace and evaluate the outcome. And you’re correct about the requests getting piped through a worker, but it’s ultimately just a passthrough that we’re in the process of deprecating as we’ve strangled all functionality to downstream systems. I appreciate the tips, this definitely give me something to check.