Skip to content

Commit

Permalink
Merge pull request #249 from framesjs/fix/getcurrentutl-env-priorities
Browse files Browse the repository at this point in the history
fix: getCurrentUrl env priorities
  • Loading branch information
stephancill authored Mar 27, 2024
2 parents 0bc117a + 29bcbc6 commit 654ba28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/new-moose-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frames.js": patch
---

fix(nextjs): prioritize APP_URL over VERCEL_URL
2 changes: 1 addition & 1 deletion packages/frames.js/src/next/getCurrentUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function getCurrentUrl(
req: Request | NextRequest | NextApiRequest | IncomingMessage
): URL | undefined {
const scheme = process.env.NODE_ENV === "production" ? "https://" : "http://";
const appUrl = process.env.VERCEL_URL || process.env.APP_URL;
const appUrl = process.env.APP_URL || process.env.VERCEL_URL;
const host: string | undefined = (req.headers as any)?.host;

const pathname = req.url?.startsWith("/")
Expand Down

0 comments on commit 654ba28

Please sign in to comment.