is undefined


The documentation says:

In addition to the information available on the Request object, such as headers, Cloudflare provides additional attributes of the request using the object.

Attributes available on :

  • country : the two letter country code on the request (this is the same value as the one provided by the CF-IPCountry header)
  • colo : the three letter airport code of the colo the request hit.

When I try to console.log and it returns undefined.


some of the headers not available in the debug mode only in production, I use it like so(saw it somewhere in the docs):
( || {}).colo


I wish that was mentioned in the documentation! Thanks for the info


also sometimes in rare cases country can return undefined so prepare for that