Skip to content

Commit

Permalink
fix: add referer to request
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Milla Martinez committed Nov 8, 2024
1 parent 74e4be0 commit 9afec87
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/api/address/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 9afec87

Please sign in to comment.