Skip to content

Commit

Permalink
fix: incorrect denylist logic for redirects (#1897)
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored Dec 14, 2024
1 parent ea440d0 commit 4747959
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ui/docs-bundle/src/server/FernNextResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class FernNextResponse {
const allowedDomains = [getHostEdge(req), ...(allowedDestinations ?? []).map((url) => new URL(url).host)];
const redirectLocation = new URL(destination);

if (!allowedDomains.includes(redirectLocation.host) || isBuildWithFern(redirectLocation.host)) {
if (!allowedDomains.includes(redirectLocation.host) && !isBuildWithFern(redirectLocation.host)) {
// open redirect to unknown host detected:
return new NextResponse(null, { status: 410 });
}
Expand Down

0 comments on commit 4747959

Please sign in to comment.