Type the middleware as returning Response | NextResponse

The crawl gateway answers with a plain Fetch Response.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YafYxayh7Gqe5MWNNQMev2
This commit is contained in:
Anthony Ettinger 2026-09-05 21:39:18 +00:00
parent 071acf6fff
commit c3c5406c70

View file

@ -7,7 +7,7 @@ import type { NextRequest } from "next/server";
// This is the Next 16 "proxy" (formerly middleware) entrypoint. // This is the Next 16 "proxy" (formerly middleware) entrypoint.
const ALLOWED_APEX = process.env.PUBLIC_DOMAIN || "logicsrc.com"; const ALLOWED_APEX = process.env.PUBLIC_DOMAIN || "logicsrc.com";
export async function proxy(request: NextRequest): Promise<NextResponse> { export async function proxy(request: NextRequest): Promise<Response | NextResponse> {
// Crawl gateway first: AI training crawlers get 402 Payment Required (or the // Crawl gateway first: AI training crawlers get 402 Payment Required (or the
// sales page at /crawl) unless they present a paid pass. People, Googlebot // sales page at /crawl) unless they present a paid pass. People, Googlebot
// and retrieval crawlers fall through to everything below. // and retrieval crawlers fall through to everything below.