From 5864aee043ef4d0dee0d98c1183711c3eaaaca1a Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Tue, 25 Apr 2023 15:58:52 -0700 Subject: [PATCH] Fixed vercel issues. --- lib/detect.ts | 4 ++-- yarn.lock | 23 ++++------------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/lib/detect.ts b/lib/detect.ts index 36219251..01e6c9a6 100644 --- a/lib/detect.ts +++ b/lib/detect.ts @@ -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']), }; } diff --git a/yarn.lock b/yarn.lock index 049c8a65..84de5a41 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3896,25 +3896,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001449: - version "1.0.30001480" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001480.tgz#9bbd35ee44c2480a1e3a3b9f4496f5066817164a" - integrity sha512-q7cpoPPvZYgtyC4VaBSN0Bt+PJ4c4EYRf0DrduInOz2SkFpHD5p3LnvEpqBp7UnJn+8x1Ogl1s38saUxe+ihQQ== - -caniuse-lite@^1.0.30001400: - version "1.0.30001427" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001427.tgz#d3a749f74be7ae0671fbec3a4eea18576e8ad646" - integrity sha512-lfXQ73oB9c8DP5Suxaszm+Ta2sr/4tf8+381GkIm1MLj/YdLf+rEDyDSRCzeltuyTVGm+/s18gdZ0q+Wmp8VsQ== - -caniuse-lite@^1.0.30001406: - version "1.0.30001470" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001470.tgz#09c8e87c711f75ff5d39804db2613dd593feeb10" - integrity sha512-065uNwY6QtHCBOExzbV6m236DDhYCCtPmQUCoQtwkVqzud8v5QPidoMr6CoMkC2nfp6nksjttqWQRRh75LqUmA== - -caniuse-lite@^1.0.30001426: - version "1.0.30001444" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001444.tgz#c0a530776eb44d933b493de1d05346f2527b30fc" - integrity sha512-ecER9xgJQVMqcrxThKptsW0pPxSae8R2RB87LNa+ivW9ppNWRHEplXcDzkCOP4LYWGj8hunXLqaiC41iBATNyg== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001400, caniuse-lite@^1.0.30001406, caniuse-lite@^1.0.30001426, caniuse-lite@^1.0.30001449: + version "1.0.30001481" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001481.tgz" + integrity sha512-KCqHwRnaa1InZBtqXzP98LPg0ajCVujMKjqKDhZEthIpAsJl/YEIa3YvXjGXPVqzZVguccuu7ga9KOE1J9rKPQ== caseless@~0.12.0: version "0.12.0"