File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import { MiddlewareHandlerContext } from "$fresh/server.ts" ;
33import { walk } from "std/fs/walk.ts" ;
44import { getSessionId } from "kv_oauth" ;
5- import { setRedirectUrlCookie } from "@/utils/redirect.ts" ;
5+ import { redirect , setRedirectUrlCookie } from "@/utils/redirect.ts" ;
6+ import { Status } from "std/http/http_status.ts" ;
67
78export interface State {
89 sessionId ?: string ;
@@ -18,7 +19,12 @@ export async function handler(
1819 req : Request ,
1920 ctx : MiddlewareHandlerContext < State > ,
2021) {
21- const { pathname } = new URL ( req . url ) ;
22+ const { pathname, hostname } = new URL ( req . url ) ;
23+
24+ if ( hostname === "saaskit.deno.dev" ) {
25+ return redirect ( "https://hunt.deno.land" , Status . Found ) ;
26+ }
27+
2228 // Don't process session-related data for keepalive and static requests
2329 if ( [ "_frsh" , ...staticFileNames ] . some ( ( part ) => pathname . includes ( part ) ) ) {
2430 return await ctx . next ( ) ;
You can’t perform that action at this time.
0 commit comments