From 9afec879f763b6e8661c668c1e4bd1043b315b47 Mon Sep 17 00:00:00 2001 From: Roberto Milla Martinez Date: Fri, 8 Nov 2024 18:07:21 +0100 Subject: [PATCH] fix: add referer to request --- src/app/api/address/route.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/api/address/route.ts b/src/app/api/address/route.ts index 2dd210af..43d17dc8 100644 --- a/src/app/api/address/route.ts +++ b/src/app/api/address/route.ts @@ -66,7 +66,11 @@ export async function POST(request: NextRequest) { } try { - const response = await fetch(`${GOOGLE_URL}${body.latitude},${body.longitude}`).then((value) => value.json()); + const response = await fetch(`${GOOGLE_URL}${body.latitude},${body.longitude}`, { + headers: { + Referer: request.headers.get('Referer') ?? '', + }, + }).then((value) => value.json()); if (response.error_message) { return Response.json({