Skip to content

Commit

Permalink
Use regionCode instead of region (#838)
Browse files Browse the repository at this point in the history
  • Loading branch information
longfangsong authored Jul 29, 2024
1 parent 2527917 commit 4bd4c19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/curly-weeks-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cloudflare/next-on-pages': minor
---

Use `request.cf.regionCode` for `x-vercel-ip-country-region` for keeping behavior consistent with documentation
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function adjustRequestForVercel(request: Request): Request {
adjustedHeaders.set('x-vercel-ip-country', request.cf.country as string);
adjustedHeaders.set(
'x-vercel-ip-country-region',
request.cf.region as string,
request.cf.regionCode as string,
);
adjustedHeaders.set('x-vercel-ip-latitude', request.cf.latitude as string);
adjustedHeaders.set(
Expand Down

0 comments on commit 4bd4c19

Please sign in to comment.