diff --git a/src/middleware.ts b/src/middleware.ts index dd4e5e816..b2b3aad82 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -1,6 +1,7 @@ import { NextRequest, NextResponse } from "next/server"; import { client } from "../studio/lib/client"; import { RedirectSparsePage } from "../studio/lib/payloads/redirect"; +import { HTTP_STATUSES } from "./utils/http"; export async function middleware(request: NextRequest) { const slug = request.nextUrl.pathname; @@ -12,7 +13,7 @@ export async function middleware(request: NextRequest) { if (redirect !== null) { return NextResponse.redirect( new URL(redirect.destination, request.url), - 307, + HTTP_STATUSES.TEMPORARY_REDIRECT, ); } } diff --git a/src/utils/http.ts b/src/utils/http.ts new file mode 100644 index 000000000..e209a9d4f --- /dev/null +++ b/src/utils/http.ts @@ -0,0 +1,3 @@ +export const HTTP_STATUSES = { + TEMPORARY_REDIRECT: 307, +};