metroCode undefined

I'm having an issue with the metro code being undefined (request.cf.metroCode). I've cloned and uploaded https://github.com/cloudflare/docs-examples/tree/main/workers/geolocation-hello-world as is, and no matter what ip address i've tested with, it's always undefined. I can confirm that maxmind has the correct data for the tested ip addresses. Is there anything that I'm missing that needs to be defined within wrangler.jsonc to enable this? Or am I missing something that's absent from the example?
GitHub
docs-examples/workers/geolocation-hello-world at main · cloudflare...
Examples surfaced in the Cloudflare Docs. Contribute to cloudflare/docs-examples development by creating an account on GitHub.
2 Replies
Walshy
Walshy3mo ago
This is a known issue - IPInfo do not publish metroCode today, we were talking to them about supporting it but not sure where that convo is currently
dward84
dward84OP3mo ago
Thanks, I guess as a workaround, a zip code to metro code map could be inlined into the JS

Did you find this page helpful?