Testing geolocation

Hello,

I am trying to figure out a way to test geolocation capabilities from Vercel.

While integrating the functionality is relatively easy, I have not figured out a way to validate what gets displayed, depending on the user’s geolocation.

Is there any way to actually override the values from x-vercel-ip-country and x-vercel-ip-country-region headers.

Tried already via middleware, or making use of a VPN, but somehow they always reflect my actual physical location, this makes testing impossible, as the only alternative seems to mock the values and hope for the best when deploying into production.

Regards and thanks in advance,
Paulo

Hi @pjmlp, thanks for reaching out in the community.

Can you confirm that you are checking the logs on the Vercel deployment? Did you try using an private browser window after connecting to the VPN?

Also, no you can’t override the Vercel set headers.

1 Like