From decf1bef7ac52221bb762bb65bbdbedf4b1e8b0d Mon Sep 17 00:00:00 2001 From: William Muli Date: Wed, 20 Sep 2023 15:03:00 +0300 Subject: [PATCH] Test vercel headers --- src/pages/api/ip.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/api/ip.ts b/src/pages/api/ip.ts index 1e737d5..2b6503b 100644 --- a/src/pages/api/ip.ts +++ b/src/pages/api/ip.ts @@ -9,6 +9,14 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) }) } + console.log('x-vercel-forwarded-for' ,req.headers['x-vercel-forwarded-for']) + console.log('x-vercel-ip-country' ,req.headers['x-vercel-ip-country']) + console.log('x-vercel-ip-country-region' ,req.headers['x-vercel-ip-country-region']) + console.log('x-vercel-ip-city' ,req.headers['x-vercel-ip-city']) + console.log('x-vercel-ip-longitude' ,req.headers['x-vercel-ip-longitude']) + console.log('x-vercel-ip-latitude' ,req.headers['x-vercel-ip-latitude']) + console.log('x-vercel-ip-timezone' ,req.headers['x-vercel-ip-timezone']) + const response = await fetch('http://ip-api.com/json/') const data = await response.json() const { status, query, ...rest } = data