Skip to content

Commit

Permalink
fix redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity committed Sep 11, 2024
1 parent fdcf82e commit fd834f8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/ui/docs-bundle/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ export const middleware: NextMiddleware = async (request) => {
*/
const isDynamic = isLoggedIn || hasError;

/**
* Rewrite all other requests to /static/[host]/[[...slug]] or /dynamic/[host]/[[...slug]]
*/

nextUrl.pathname = getPageRoute(!isDynamic, xFernHost, pathname);

/**
* Mock the /_next/data/... request to the corresponding page route
*/
Expand Down Expand Up @@ -158,6 +152,8 @@ export const middleware: NextMiddleware = async (request) => {
/**
* Rewrite all other requests to /static/[host]/[[...slug]] or /dynamic/[host]/[[...slug]]
*/

nextUrl.pathname = getPageRoute(!isDynamic, xFernHost, pathname);
return NextResponse.rewrite(nextUrl, { request: { headers } });
};

Expand Down

0 comments on commit fd834f8

Please sign in to comment.