diff --git a/routes/_middleware.ts b/routes/_middleware.ts index 56c57b488..8ba33507b 100644 --- a/routes/_middleware.ts +++ b/routes/_middleware.ts @@ -2,7 +2,8 @@ import { MiddlewareHandlerContext } from "$fresh/server.ts"; import { walk } from "std/fs/walk.ts"; import { getSessionId } from "kv_oauth"; -import { setRedirectUrlCookie } from "@/utils/redirect.ts"; +import { redirect, setRedirectUrlCookie } from "@/utils/redirect.ts"; +import { Status } from "std/http/http_status.ts"; export interface State { sessionId?: string; @@ -18,7 +19,12 @@ export async function handler( req: Request, ctx: MiddlewareHandlerContext, ) { - const { pathname } = new URL(req.url); + const { pathname, hostname } = new URL(req.url); + + if (hostname === "saaskit.deno.dev") { + return redirect("https://hunt.deno.land", Status.Found); + } + // Don't process session-related data for keepalive and static requests if (["_frsh", ...staticFileNames].some((part) => pathname.includes(part))) { return await ctx.next();