Fixed vercel issues.

This commit is contained in:
Mike Cao 2023-04-25 15:58:52 -07:00
parent c49e2c6974
commit 5864aee043
2 changed files with 6 additions and 21 deletions

View file

@ -65,8 +65,8 @@ export async function getLocation(ip, req) {
if (req.headers['x-vercel-ip-country']) {
return {
country: req.headers['x-vercel-ip-country'],
subdivision1: `${req.headers['x-vercel-ip-country']}-${req.headers['x-vercel-ip-country-region']}`,
city: req.headers['x-vercel-ip-city'],
subdivision1: req.headers['x-vercel-ip-country-region'],
city: decodeURIComponent(req.headers['x-vercel-ip-city']),
};
}