Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: Url hostname in middleware

Richie McIlroybfc05384d24f
diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts
index 56a16b9fb..9268b4556 100644
--- a/apps/web/middleware.ts
+++ b/apps/web/middleware.ts
@@ -16,8 +16,9 @@ const mainDomains = [
].filter(Boolean) as string[];
export async function middleware(request: NextRequest) {
- const hostname = request.headers.get("host");
- const path = request.nextUrl.pathname;
+ const url = new URL(request.url);
+ const hostname = url.hostname;
+ const path = url.pathname;
if (!hostname) return NextResponse.next();