Spaces:
Running
Running
try new thing
Browse files- middleware.ts +1 -2
middleware.ts
CHANGED
|
@@ -7,9 +7,8 @@ export function middleware(request: NextRequest) {
|
|
| 7 |
const isLocalhost = host.startsWith("localhost") || host.startsWith("127.0.0.1");
|
| 8 |
const isCorrectDomain = host === "huggingface.co" || host.startsWith("huggingface.co:");
|
| 9 |
|
| 10 |
-
console.log("++ DOMAIN CHECK ++", host)
|
| 11 |
if (!isCorrectDomain && !isLocalhost) {
|
| 12 |
-
return NextResponse.redirect("https://huggingface.co/deepsite", 301);
|
| 13 |
}
|
| 14 |
|
| 15 |
const headers = new Headers(request.headers);
|
|
|
|
| 7 |
const isLocalhost = host.startsWith("localhost") || host.startsWith("127.0.0.1");
|
| 8 |
const isCorrectDomain = host === "huggingface.co" || host.startsWith("huggingface.co:");
|
| 9 |
|
|
|
|
| 10 |
if (!isCorrectDomain && !isLocalhost) {
|
| 11 |
+
return NextResponse.redirect(new URL("https://huggingface.co/deepsite"), 301);
|
| 12 |
}
|
| 13 |
|
| 14 |
const headers = new Headers(request.headers);
|