Previously, I was using Cloud Functions (Gen1), and I could access App Engine–specific headers such as:
X-Appengine-Country X-Appengine-Region X-Appengine-City X-Appengine-Citylatlong
These were very convenient for getting the client’s geo location directly from the request headers.
However, after upgrading my functions to Cloud Run Gen2 (due to Go runtime deprecations), these headers no longer appear in the incoming requests.
Is there any alternative way to get the same geolocation info (country, region, city) without changing my function’s domain or routing all traffic through a Load Balancer?
As far as I know, putting a load balancer in front of the function means changing the domain used to send requests — in other words, previously I could send requests directly to the function’s URL, but after adding a load balancer, I would need to send them to the load balancer’s URL instead. Changing the request domain is not something I want.