/home/techb158/balavpn.abdallabala.com/node_modules/next/dist/server
NameSizeModeActions
after/-0777rm
api-utils/-0777rm
app-render/-0777rm
async-storage/-0777rm
base-http/-0777rm
dev/-0777rm
instrumentation/-0777rm
lib/-0777rm
node-environment-extensions/-0777rm
normalizers/-0777rm
og/-0777rm
request/-0777rm
response-cache/-0777rm
resume-data-cache/-0777rm
route-definitions/-0777rm
route-matcher-managers/-0777rm
route-matcher-providers/-0777rm
route-matchers/-0777rm
route-matches/-0777rm
route-modules/-0777rm
stream-utils/-0777rm
typescript/-0777rm
use-cache/-0777rm
web/-0777rm
accept-header.d.ts980666editdlrm
accept-header.js40620666editdlrm
accept-header.js.map64740666editdlrm
base-server.d.ts148180666editdlrm
base-server.js1024910666editdlrm
base-server.js.map1637210666editdlrm
body-streams.d.ts4740666editdlrm
body-streams.js36550666editdlrm
body-streams.js.map54420666editdlrm
cache-dir.d.ts820666editdlrm
cache-dir.js7570666editdlrm
cache-dir.js.map7030666editdlrm
capsize-font-metrics.json43016220666editdlrm
ci-info.d.ts1240666editdlrm
ci-info.js11420666editdlrm
ci-info.js.map13140666editdlrm
client-component-renderer-logger.d.ts4050666editdlrm
client-component-renderer-logger.js22870666editdlrm
client-component-renderer-logger.js.map30360666editdlrm
config-schema.d.ts1510666editdlrm
config-schema.js303360666editdlrm
config-schema.js.map567480666editdlrm
config-shared.d.ts492800666editdlrm
config-shared.js72780666editdlrm
config-shared.js.map580640666editdlrm
config-utils.d.ts490666editdlrm
config-utils.js58880666editdlrm
config-utils.js.map66000666editdlrm
config.d.ts11590666editdlrm
config.js743130666editdlrm
config.js.map995600666editdlrm
create-deduped-by-callsite-server-error-logger.d.ts5910666editdlrm
create-deduped-by-callsite-server-error-logger.js35840666editdlrm
create-deduped-by-callsite-server-error-logger.js.map36670666editdlrm
crypto-utils.d.ts1710666editdlrm
crypto-utils.js30260666editdlrm
crypto-utils.js.map43690666editdlrm
dynamic-rendering-utils.d.ts4250666editdlrm
dynamic-rendering-utils.js33880666editdlrm
dynamic-rendering-utils.js.map49390666editdlrm
font-utils.d.ts1770666editdlrm
font-utils.js17760666editdlrm
font-utils.js.map30600666editdlrm
get-app-route-from-entrypoint.d.ts850666editdlrm
get-app-route-from-entrypoint.js8320666editdlrm
get-app-route-from-entrypoint.js.map8650666editdlrm
get-page-files.d.ts5360666editdlrm
get-page-files.js8070666editdlrm
get-page-files.js.map16920666editdlrm
get-route-from-entrypoint.d.ts970666editdlrm
get-route-from-entrypoint.js12450666editdlrm
get-route-from-entrypoint.js.map14150666editdlrm
image-optimizer.d.ts47210666editdlrm
image-optimizer.js380460666editdlrm
image-optimizer.js.map566470666editdlrm
internal-utils.d.ts2230666editdlrm
internal-utils.js11270666editdlrm
internal-utils.js.map13470666editdlrm
load-components.d.ts29880666editdlrm
load-components.js70160666editdlrm
load-components.js.map131700666editdlrm
load-default-error-components.d.ts13520666editdlrm
load-default-error-components.js18870666editdlrm
load-default-error-components.js.map38260666editdlrm
load-manifest.external.d.ts18080666editdlrm
load-manifest.external.js30510666editdlrm
load-manifest.external.js.map58270666editdlrm
match-bundle.d.ts820666editdlrm
match-bundle.js6860666editdlrm
match-bundle.js.map7180666editdlrm
next-server.d.ts114480666editdlrm
next-server.js700380666editdlrm
next-server.js.map1103260666editdlrm
next-typescript.d.ts470666editdlrm
next-typescript.js3180666editdlrm
next-typescript.js.map2220666editdlrm
next.d.ts36460666editdlrm
next.js157070666editdlrm
next.js.map268160666editdlrm
node-environment-baseline.d.ts00666editdlrm
node-environment-baseline.js8900666editdlrm
node-environment-baseline.js.map15550666editdlrm
node-environment.d.ts2870666editdlrm
node-environment.js6480666editdlrm
node-environment.js.map10650666editdlrm
node-polyfill-crypto.d.ts00666editdlrm
node-polyfill-crypto.js5580666editdlrm
node-polyfill-crypto.js.map10140666editdlrm
optimize-amp.d.ts780666editdlrm
optimize-amp.js5490666editdlrm
optimize-amp.js.map8390666editdlrm
patch-error-inspect.d.ts4670666editdlrm
patch-error-inspect.js196530666editdlrm
patch-error-inspect.js.map285010666editdlrm
pipe-readable.d.ts2910666editdlrm
pipe-readable.js55980666editdlrm
pipe-readable.js.map76770666editdlrm
post-process.d.ts3720666editdlrm
post-process.js20060666editdlrm
post-process.js.map39830666editdlrm
ReactDOMServerPages.d.ts380666editdlrm
ReactDOMServerPages.js5980666editdlrm
ReactDOMServerPages.js.map9570666editdlrm
render-result.d.ts62410666editdlrm
render-result.js75550666editdlrm
render-result.js.map142430666editdlrm
render.d.ts48870666editdlrm
render.js557840666editdlrm
render.js.map850560666editdlrm
request-meta.d.ts80310666editdlrm
request-meta.js14650666editdlrm
request-meta.js.map94610666editdlrm
require-hook.d.ts2660666editdlrm
require-hook.js28400666editdlrm
require-hook.js.map44530666editdlrm
require.d.ts3770666editdlrm
require.js39220666editdlrm
require.js.map60480666editdlrm
revalidation-utils.d.ts5410666editdlrm
revalidation-utils.js33410666editdlrm
revalidation-utils.js.map57330666editdlrm
route-kind.d.ts7200666editdlrm
route-kind.js10290666editdlrm
route-kind.js.map9370666editdlrm
send-payload.d.ts5970666editdlrm
send-payload.js28490666editdlrm
send-payload.js.map42140666editdlrm
send-response.d.ts4200666editdlrm
send-response.js30650666editdlrm
send-response.js.map45590666editdlrm
serve-static.d.ts4030666editdlrm
serve-static.js21100666editdlrm
serve-static.js.map26800666editdlrm
server-route-utils.d.ts1970666editdlrm
server-route-utils.js11300666editdlrm
server-route-utils.js.map19350666editdlrm
server-utils.d.ts31340666editdlrm
server-utils.js165420666editdlrm
server-utils.js.map260640666editdlrm
setup-http-agent-env.d.ts1720666editdlrm
setup-http-agent-env.js10500666editdlrm
setup-http-agent-env.js.map14060666editdlrm
utils.d.ts3320666editdlrm
utils.js32080666editdlrm
utils.js.map41810666editdlrm
Edit: /home/techb158/balavpn.abdallabala.com/node_modules/next/dist/server/base-server.js.map (163721B)
{"version":3,"sources":["../../src/server/base-server.ts"],"sourcesContent":["import type { __ApiPreviewProps } from './api-utils'\nimport type { LoadComponentsReturnType } from './load-components'\nimport type { MiddlewareRouteMatch } from '../shared/lib/router/utils/middleware-route-matcher'\nimport type { Params } from './request/params'\nimport type { NextConfig, NextConfigComplete } from './config-shared'\nimport type {\n NextParsedUrlQuery,\n NextUrlWithParsedQuery,\n RequestMeta,\n} from './request-meta'\nimport type { ParsedUrlQuery } from 'querystring'\nimport type { RenderOptsPartial as PagesRenderOptsPartial } from './render'\nimport type {\n RenderOptsPartial as AppRenderOptsPartial,\n ServerOnInstrumentationRequestError,\n} from './app-render/types'\nimport type {\n ServerComponentsHmrCache,\n ResponseCacheBase,\n} from './response-cache'\nimport type { UrlWithParsedQuery } from 'url'\nimport {\n NormalizeError,\n DecodeError,\n normalizeRepeatedSlashes,\n MissingStaticPage,\n} from '../shared/lib/utils'\nimport type { PagesManifest } from '../build/webpack/plugins/pages-manifest-plugin'\nimport type { BaseNextRequest, BaseNextResponse } from './base-http'\nimport type {\n ManifestRewriteRoute,\n ManifestRoute,\n PrerenderManifest,\n} from '../build'\nimport type { ClientReferenceManifest } from '../build/webpack/plugins/flight-manifest-plugin'\nimport type { NextFontManifest } from '../build/webpack/plugins/next-font-manifest-plugin'\nimport type { PagesAPIRouteMatch } from './route-matches/pages-api-route-match'\nimport type {\n Server as HTTPServer,\n IncomingMessage,\n ServerResponse as HTTPServerResponse,\n} from 'http'\nimport type { MiddlewareMatcher } from '../build/analysis/get-page-static-info'\nimport type { TLSSocket } from 'tls'\nimport type { PathnameNormalizer } from './normalizers/request/pathname-normalizer'\nimport type { InstrumentationModule } from './instrumentation/types'\n\nimport { format as formatUrl, parse as parseUrl } from 'url'\nimport { formatHostname } from './lib/format-hostname'\nimport { isRSCRequestHeader } from './lib/is-rsc-request'\nimport {\n APP_PATHS_MANIFEST,\n NEXT_BUILTIN_DOCUMENT,\n PAGES_MANIFEST,\n STATIC_STATUS_PAGES,\n UNDERSCORE_NOT_FOUND_ROUTE,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n} from '../shared/lib/constants'\nimport { isDynamicRoute } from '../shared/lib/router/utils'\nimport { setConfig } from '../shared/lib/runtime-config.external'\nimport { execOnce } from '../shared/lib/utils'\nimport { isBlockedPage } from './utils'\nimport { getBotType, isBot } from '../shared/lib/router/utils/is-bot'\nimport RenderResult from './render-result'\nimport { removeTrailingSlash } from '../shared/lib/router/utils/remove-trailing-slash'\nimport { denormalizePagePath } from '../shared/lib/page-path/denormalize-page-path'\nimport * as Log from '../build/output/log'\nimport { getPreviouslyRevalidatedTags, getServerUtils } from './server-utils'\nimport isError, { getProperError } from '../lib/is-error'\nimport {\n addRequestMeta,\n getRequestMeta,\n removeRequestMeta,\n setRequestMeta,\n} from './request-meta'\nimport { removePathPrefix } from '../shared/lib/router/utils/remove-path-prefix'\nimport { normalizeAppPath } from '../shared/lib/router/utils/app-paths'\nimport { getHostname } from '../shared/lib/get-hostname'\nimport { parseUrl as parseUrlUtil } from '../shared/lib/router/utils/parse-url'\nimport { getNextPathnameInfo } from '../shared/lib/router/utils/get-next-pathname-info'\nimport {\n RSC_HEADER,\n NEXT_RSC_UNION_QUERY,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n NEXT_URL,\n NEXT_ROUTER_STATE_TREE_HEADER,\n} from '../client/components/app-router-headers'\nimport type {\n MatchOptions,\n RouteMatcherManager,\n} from './route-matcher-managers/route-matcher-manager'\nimport { LocaleRouteNormalizer } from './normalizers/locale-route-normalizer'\nimport { DefaultRouteMatcherManager } from './route-matcher-managers/default-route-matcher-manager'\nimport { AppPageRouteMatcherProvider } from './route-matcher-providers/app-page-route-matcher-provider'\nimport { AppRouteRouteMatcherProvider } from './route-matcher-providers/app-route-route-matcher-provider'\nimport { PagesAPIRouteMatcherProvider } from './route-matcher-providers/pages-api-route-matcher-provider'\nimport { PagesRouteMatcherProvider } from './route-matcher-providers/pages-route-matcher-provider'\nimport { ServerManifestLoader } from './route-matcher-providers/helpers/manifest-loaders/server-manifest-loader'\nimport {\n getTracer,\n isBubbledError,\n SpanKind,\n SpanStatusCode,\n} from './lib/trace/tracer'\nimport { BaseServerSpan } from './lib/trace/constants'\nimport { I18NProvider } from './lib/i18n-provider'\nimport { sendResponse } from './send-response'\nimport { normalizeNextQueryParam } from './web/utils'\nimport {\n HTML_CONTENT_TYPE_HEADER,\n JSON_CONTENT_TYPE_HEADER,\n MATCHED_PATH_HEADER,\n NEXT_RESUME_HEADER,\n} from '../lib/constants'\nimport { normalizeLocalePath } from '../shared/lib/i18n/normalize-locale-path'\nimport { matchNextDataPathname } from './lib/match-next-data-pathname'\nimport getRouteFromAssetPath from '../shared/lib/router/utils/get-route-from-asset-path'\nimport { RSCPathnameNormalizer } from './normalizers/request/rsc'\nimport { stripFlightHeaders } from './app-render/strip-flight-headers'\nimport {\n isAppPageRouteModule,\n isAppRouteRouteModule,\n} from './route-modules/checks'\nimport { PrefetchRSCPathnameNormalizer } from './normalizers/request/prefetch-rsc'\nimport { NextDataPathnameNormalizer } from './normalizers/request/next-data'\nimport { getIsPossibleServerAction } from './lib/server-action-request-meta'\nimport { isInterceptionRouteAppPath } from '../shared/lib/router/utils/interception-routes'\nimport { toRoute } from './lib/to-route'\nimport type { DeepReadonly } from '../shared/lib/deep-readonly'\nimport { isNodeNextRequest, isNodeNextResponse } from './base-http/helpers'\nimport { patchSetHeaderWithCookieSupport } from './lib/patch-set-header'\nimport { checkIsAppPPREnabled } from './lib/experimental/ppr'\nimport {\n getBuiltinRequestContext,\n type WaitUntil,\n} from './after/builtin-request-context'\nimport { NextRequestHint } from './web/adapter'\nimport type { RouteModule } from './route-modules/route-module'\nimport { type FallbackMode, parseFallbackField } from '../lib/fallback'\nimport { SegmentPrefixRSCPathnameNormalizer } from './normalizers/request/segment-prefix-rsc'\nimport { shouldServeStreamingMetadata } from './lib/streaming-metadata'\nimport { decodeQueryPathParameter } from './lib/decode-query-path-parameter'\nimport { NoFallbackError } from '../shared/lib/no-fallback-error.external'\nimport { getCacheHandlers } from './use-cache/handlers'\nimport { fixMojibake } from './lib/fix-mojibake'\nimport { setCacheBustingSearchParamWithHash } from '../client/components/router-reducer/set-cache-busting-search-param'\nimport type { CacheControl } from './lib/cache-control'\nimport type { PrerenderedRoute } from '../build/static-paths/types'\nimport {\n computeCacheBustingSearchParam,\n computeLegacyCacheBustingSearchParam,\n} from '../shared/lib/router/utils/cache-busting-search-param'\n\nexport type FindComponentsResult = {\n components: LoadComponentsReturnType\n query: NextParsedUrlQuery\n}\n\nexport interface MiddlewareRoutingItem {\n page: string\n match: MiddlewareRouteMatch\n matchers?: MiddlewareMatcher[]\n}\n\nexport type RouteHandler<\n ServerRequest extends BaseNextRequest = BaseNextRequest,\n ServerResponse extends BaseNextResponse = BaseNextResponse,\n> = (\n req: ServerRequest,\n res: ServerResponse,\n parsedUrl: NextUrlWithParsedQuery\n) => PromiseLike | boolean\n\n/**\n * The normalized route manifest is the same as the route manifest, but with\n * the rewrites normalized to the object shape that the router expects.\n */\nexport type NormalizedRouteManifest = {\n readonly dynamicRoutes: ReadonlyArray\n readonly rewrites: {\n readonly beforeFiles: ReadonlyArray\n readonly afterFiles: ReadonlyArray\n readonly fallback: ReadonlyArray\n }\n}\n\nexport interface Options {\n /**\n * Object containing the configuration next.config.js\n */\n conf: NextConfig\n /**\n * Set to false when the server was created by Next.js\n */\n customServer?: boolean\n /**\n * Tells if Next.js is running in dev mode\n */\n dev?: boolean\n /**\n * Enables the experimental testing mode.\n */\n experimentalTestProxy?: boolean\n\n /**\n * Whether or not the dev server is running in experimental HTTPS mode\n */\n experimentalHttpsServer?: boolean\n /**\n * Where the Next project is located\n */\n dir?: string\n /**\n * Tells if Next.js is at the platform-level\n */\n minimalMode?: boolean\n /**\n * Hide error messages containing server information\n */\n quiet?: boolean\n /**\n * The hostname the server is running behind\n */\n hostname?: string\n /**\n * The port the server is running behind\n */\n port?: number\n /**\n * The HTTP Server that Next.js is running behind\n */\n httpServer?: HTTPServer\n}\n\nexport type RenderOpts = PagesRenderOptsPartial & AppRenderOptsPartial\n\nexport type LoadedRenderOpts = RenderOpts &\n LoadComponentsReturnType &\n RequestLifecycleOpts\n\nexport type RequestLifecycleOpts = {\n waitUntil: ((promise: Promise) => void) | undefined\n onClose: (callback: () => void) => void\n onAfterTaskError: ((error: unknown) => void) | undefined\n}\n\ntype BaseRenderOpts = RenderOpts & {\n poweredByHeader: boolean\n generateEtags: boolean\n previewProps: __ApiPreviewProps\n}\n\n/**\n * The public interface for rendering with the server programmatically. This\n * would typically only allow the base request or response to extend it, but\n * because this can be programmatically accessed, we assume that it could also\n * be the base Node.js request and response types.\n */\nexport interface BaseRequestHandler<\n ServerRequest extends BaseNextRequest | IncomingMessage = BaseNextRequest,\n ServerResponse extends\n | BaseNextResponse\n | HTTPServerResponse = BaseNextResponse,\n> {\n (\n req: ServerRequest,\n res: ServerResponse,\n parsedUrl?: NextUrlWithParsedQuery | undefined\n ): Promise | void\n}\n\nexport type RequestContext<\n ServerRequest extends BaseNextRequest = BaseNextRequest,\n ServerResponse extends BaseNextResponse = BaseNextResponse,\n> = {\n req: ServerRequest\n res: ServerResponse\n pathname: string\n query: NextParsedUrlQuery\n renderOpts: RenderOpts\n}\n\n// Internal wrapper around build errors at development\n// time, to prevent us from propagating or logging them\nexport class WrappedBuildError extends Error {\n innerError: Error\n\n constructor(innerError: Error) {\n super()\n this.innerError = innerError\n }\n}\n\ntype ResponsePayload = {\n body: RenderResult\n cacheControl?: CacheControl\n}\n\nexport type NextEnabledDirectories = {\n readonly pages: boolean\n readonly app: boolean\n}\n\nexport default abstract class Server<\n ServerOptions extends Options = Options,\n ServerRequest extends BaseNextRequest = BaseNextRequest,\n ServerResponse extends BaseNextResponse = BaseNextResponse,\n> {\n public readonly hostname?: string\n public readonly fetchHostname?: string\n public readonly port?: number\n protected readonly dir: string\n protected readonly quiet: boolean\n protected readonly nextConfig: NextConfigComplete\n protected readonly distDir: string\n protected readonly publicDir: string\n protected readonly hasStaticDir: boolean\n protected readonly pagesManifest?: PagesManifest\n protected readonly appPathsManifest?: PagesManifest\n protected readonly buildId: string\n protected readonly minimalMode: boolean\n protected readonly renderOpts: BaseRenderOpts\n protected readonly serverOptions: Readonly\n protected readonly appPathRoutes?: Record\n protected readonly clientReferenceManifest?: DeepReadonly\n protected interceptionRoutePatterns: RegExp[]\n protected nextFontManifest?: DeepReadonly\n protected instrumentation: InstrumentationModule | undefined\n private readonly responseCache: ResponseCacheBase\n\n protected abstract getPublicDir(): string\n protected abstract getHasStaticDir(): boolean\n protected abstract getPagesManifest(): PagesManifest | undefined\n protected abstract getAppPathsManifest(): PagesManifest | undefined\n protected abstract getBuildId(): string\n protected abstract getinterceptionRoutePatterns(): RegExp[]\n\n protected readonly enabledDirectories: NextEnabledDirectories\n protected abstract getEnabledDirectories(dev: boolean): NextEnabledDirectories\n\n protected readonly experimentalTestProxy?: boolean\n\n protected abstract findPageComponents(params: {\n locale: string | undefined\n page: string\n query: NextParsedUrlQuery\n params: Params\n isAppPath: boolean\n // The following parameters are used in the development server's\n // implementation.\n sriEnabled?: boolean\n appPaths?: ReadonlyArray | null\n shouldEnsure?: boolean\n url?: string\n }): Promise\n protected abstract getPrerenderManifest(): DeepReadonly\n protected abstract getNextFontManifest():\n | DeepReadonly\n | undefined\n protected abstract attachRequestMeta(\n req: ServerRequest,\n parsedUrl: NextUrlWithParsedQuery\n ): void\n protected abstract hasPage(pathname: string): Promise\n\n protected abstract sendRenderResult(\n req: ServerRequest,\n res: ServerResponse,\n options: {\n result: RenderResult\n generateEtags: boolean\n poweredByHeader: boolean\n cacheControl: CacheControl | undefined\n }\n ): Promise\n\n protected abstract runApi(\n req: ServerRequest,\n res: ServerResponse,\n query: ParsedUrlQuery,\n match: PagesAPIRouteMatch\n ): Promise\n\n protected abstract renderHTML(\n req: ServerRequest,\n res: ServerResponse,\n pathname: string,\n query: NextParsedUrlQuery,\n renderOpts: LoadedRenderOpts\n ): Promise\n\n protected abstract getIncrementalCache(options: {\n requestHeaders: Record\n }): Promise\n\n protected abstract getResponseCache(options: {\n dev: boolean\n }): ResponseCacheBase\n\n protected getServerComponentsHmrCache():\n | ServerComponentsHmrCache\n | undefined {\n return this.nextConfig.experimental.serverComponentsHmrCache\n ? (globalThis as any).__serverComponentsHmrCache\n : undefined\n }\n\n protected abstract loadEnvConfig(params: {\n dev: boolean\n forceReload?: boolean\n }): void\n\n // TODO-APP: (wyattjoh): Make protected again. Used for turbopack in route-resolver.ts right now.\n public readonly matchers: RouteMatcherManager\n protected readonly i18nProvider?: I18NProvider\n protected readonly localeNormalizer?: LocaleRouteNormalizer\n\n protected readonly normalizers: {\n readonly rsc: RSCPathnameNormalizer | undefined\n readonly prefetchRSC: PrefetchRSCPathnameNormalizer | undefined\n readonly segmentPrefetchRSC: SegmentPrefixRSCPathnameNormalizer | undefined\n readonly data: NextDataPathnameNormalizer | undefined\n }\n\n private readonly isAppPPREnabled: boolean\n private readonly isAppSegmentPrefetchEnabled: boolean\n\n /**\n * This is used to persist cache scopes across\n * prefetch -> full route requests for cache components\n * it's only fully used in dev\n */\n\n public constructor(options: ServerOptions) {\n const {\n dir = '.',\n quiet = false,\n conf,\n dev = false,\n minimalMode = false,\n hostname,\n port,\n experimentalTestProxy,\n } = options\n\n this.experimentalTestProxy = experimentalTestProxy\n this.serverOptions = options\n\n this.dir = (require('path') as typeof import('path')).resolve(dir)\n\n this.quiet = quiet\n this.loadEnvConfig({ dev })\n\n // TODO: should conf be normalized to prevent missing\n // values from causing issues as this can be user provided\n this.nextConfig = conf as NextConfigComplete\n this.hostname = hostname\n if (this.hostname) {\n // we format the hostname so that it can be fetched\n this.fetchHostname = formatHostname(this.hostname)\n }\n this.port = port\n this.distDir = (require('path') as typeof import('path')).join(\n this.dir,\n this.nextConfig.distDir\n )\n this.publicDir = this.getPublicDir()\n this.hasStaticDir = !minimalMode && this.getHasStaticDir()\n\n this.i18nProvider = this.nextConfig.i18n?.locales\n ? new I18NProvider(this.nextConfig.i18n)\n : undefined\n\n // Configure the locale normalizer, it's used for routes inside `pages/`.\n this.localeNormalizer = this.i18nProvider\n ? new LocaleRouteNormalizer(this.i18nProvider)\n : undefined\n\n // Only serverRuntimeConfig needs the default\n // publicRuntimeConfig gets it's default in client/index.js\n const {\n serverRuntimeConfig = {},\n publicRuntimeConfig,\n assetPrefix,\n generateEtags,\n } = this.nextConfig\n\n this.buildId = this.getBuildId()\n // this is a hack to avoid Webpack knowing this is equal to this.minimalMode\n // because we replace this.minimalMode to true in production bundles.\n const minimalModeKey = 'minimalMode'\n this[minimalModeKey] =\n minimalMode || !!process.env.NEXT_PRIVATE_MINIMAL_MODE\n\n this.enabledDirectories = this.getEnabledDirectories(dev)\n\n this.isAppPPREnabled =\n this.enabledDirectories.app &&\n checkIsAppPPREnabled(this.nextConfig.experimental.ppr)\n\n this.isAppSegmentPrefetchEnabled =\n this.enabledDirectories.app &&\n this.nextConfig.experimental.clientSegmentCache === true\n\n this.normalizers = {\n // We should normalize the pathname from the RSC prefix only in minimal\n // mode as otherwise that route is not exposed external to the server as\n // we instead only rely on the headers.\n rsc:\n this.enabledDirectories.app && this.minimalMode\n ? new RSCPathnameNormalizer()\n : undefined,\n prefetchRSC:\n this.isAppPPREnabled && this.minimalMode\n ? new PrefetchRSCPathnameNormalizer()\n : undefined,\n segmentPrefetchRSC:\n this.isAppSegmentPrefetchEnabled && this.minimalMode\n ? new SegmentPrefixRSCPathnameNormalizer()\n : undefined,\n data: this.enabledDirectories.pages\n ? new NextDataPathnameNormalizer(this.buildId)\n : undefined,\n }\n\n this.nextFontManifest = this.getNextFontManifest()\n process.env.NEXT_DEPLOYMENT_ID = this.nextConfig.deploymentId || ''\n\n this.renderOpts = {\n dir: this.dir,\n supportsDynamicResponse: true,\n trailingSlash: this.nextConfig.trailingSlash,\n deploymentId: this.nextConfig.deploymentId,\n poweredByHeader: this.nextConfig.poweredByHeader,\n canonicalBase: this.nextConfig.amp.canonicalBase || '',\n generateEtags,\n previewProps: this.getPrerenderManifest().preview,\n ampOptimizerConfig: this.nextConfig.experimental.amp?.optimizer,\n basePath: this.nextConfig.basePath,\n images: this.nextConfig.images,\n optimizeCss: this.nextConfig.experimental.optimizeCss,\n nextConfigOutput: this.nextConfig.output,\n nextScriptWorkers: this.nextConfig.experimental.nextScriptWorkers,\n disableOptimizedLoading:\n this.nextConfig.experimental.disableOptimizedLoading,\n domainLocales: this.nextConfig.i18n?.domains,\n distDir: this.distDir,\n serverComponents: this.enabledDirectories.app,\n cacheLifeProfiles: this.nextConfig.experimental.cacheLife,\n enableTainting: this.nextConfig.experimental.taint,\n crossOrigin: this.nextConfig.crossOrigin\n ? this.nextConfig.crossOrigin\n : undefined,\n largePageDataBytes: this.nextConfig.experimental.largePageDataBytes,\n // Only the `publicRuntimeConfig` key is exposed to the client side\n // It'll be rendered as part of __NEXT_DATA__ on the client side\n runtimeConfig:\n Object.keys(publicRuntimeConfig).length > 0\n ? publicRuntimeConfig\n : undefined,\n\n isExperimentalCompile: this.nextConfig.experimental.isExperimentalCompile,\n // `htmlLimitedBots` is passed to server as serialized config in string format\n htmlLimitedBots: this.nextConfig.htmlLimitedBots,\n experimental: {\n expireTime: this.nextConfig.expireTime,\n staleTimes: this.nextConfig.experimental.staleTimes,\n clientTraceMetadata: this.nextConfig.experimental.clientTraceMetadata,\n cacheComponents: this.nextConfig.experimental.cacheComponents ?? false,\n clientSegmentCache:\n this.nextConfig.experimental.clientSegmentCache === 'client-only'\n ? 'client-only'\n : Boolean(this.nextConfig.experimental.clientSegmentCache),\n clientParamParsing:\n this.nextConfig.experimental.clientParamParsing ?? false,\n dynamicOnHover: this.nextConfig.experimental.dynamicOnHover ?? false,\n inlineCss: this.nextConfig.experimental.inlineCss ?? false,\n authInterrupts: !!this.nextConfig.experimental.authInterrupts,\n },\n onInstrumentationRequestError:\n this.instrumentationOnRequestError.bind(this),\n reactMaxHeadersLength: this.nextConfig.reactMaxHeadersLength,\n devtoolSegmentExplorer:\n this.nextConfig.experimental.devtoolSegmentExplorer,\n }\n\n // Initialize next/config with the environment configuration\n setConfig({\n serverRuntimeConfig,\n publicRuntimeConfig,\n })\n\n this.pagesManifest = this.getPagesManifest()\n this.appPathsManifest = this.getAppPathsManifest()\n this.appPathRoutes = this.getAppPathRoutes()\n this.interceptionRoutePatterns = this.getinterceptionRoutePatterns()\n\n // Configure the routes.\n this.matchers = this.getRouteMatchers()\n\n // Start route compilation. We don't wait for the routes to finish loading\n // because we use the `waitTillReady` promise below in `handleRequest` to\n // wait. Also we can't `await` in the constructor.\n void this.matchers.reload()\n\n this.setAssetPrefix(assetPrefix)\n this.responseCache = this.getResponseCache({ dev })\n }\n\n private handleRSCRequest: RouteHandler = (\n req,\n _res,\n parsedUrl\n ) => {\n if (!parsedUrl.pathname) return false\n\n if (this.normalizers.segmentPrefetchRSC?.match(parsedUrl.pathname)) {\n const result = this.normalizers.segmentPrefetchRSC.extract(\n parsedUrl.pathname\n )\n if (!result) return false\n\n const { originalPathname, segmentPath } = result\n parsedUrl.pathname = originalPathname\n\n // Mark the request as a router prefetch request.\n req.headers[RSC_HEADER] = '1'\n req.headers[NEXT_ROUTER_PREFETCH_HEADER] = '1'\n req.headers[NEXT_ROUTER_SEGMENT_PREFETCH_HEADER] = segmentPath\n\n addRequestMeta(req, 'isRSCRequest', true)\n addRequestMeta(req, 'isPrefetchRSCRequest', true)\n addRequestMeta(req, 'segmentPrefetchRSCRequest', segmentPath)\n } else if (this.normalizers.prefetchRSC?.match(parsedUrl.pathname)) {\n parsedUrl.pathname = this.normalizers.prefetchRSC.normalize(\n parsedUrl.pathname,\n true\n )\n\n // Mark the request as a router prefetch request.\n req.headers[RSC_HEADER] = '1'\n req.headers[NEXT_ROUTER_PREFETCH_HEADER] = '1'\n addRequestMeta(req, 'isRSCRequest', true)\n addRequestMeta(req, 'isPrefetchRSCRequest', true)\n } else if (this.normalizers.rsc?.match(parsedUrl.pathname)) {\n parsedUrl.pathname = this.normalizers.rsc.normalize(\n parsedUrl.pathname,\n true\n )\n\n // Mark the request as a RSC request.\n req.headers[RSC_HEADER] = '1'\n addRequestMeta(req, 'isRSCRequest', true)\n } else if (req.headers['x-now-route-matches']) {\n // If we didn't match, return with the flight headers stripped. If in\n // minimal mode we didn't match based on the path, this can't be a RSC\n // request. This is because Vercel only sends this header during\n // revalidation requests and we want the cache to instead depend on the\n // request path for flight information.\n stripFlightHeaders(req.headers)\n\n return false\n } else if (isRSCRequestHeader(req.headers[RSC_HEADER])) {\n addRequestMeta(req, 'isRSCRequest', true)\n\n if (req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1') {\n addRequestMeta(req, 'isPrefetchRSCRequest', true)\n\n const segmentPrefetchRSCRequest =\n req.headers[NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]\n if (typeof segmentPrefetchRSCRequest === 'string') {\n addRequestMeta(\n req,\n 'segmentPrefetchRSCRequest',\n segmentPrefetchRSCRequest\n )\n }\n }\n } else {\n // Otherwise just return without doing anything.\n return false\n }\n\n if (req.url) {\n const parsed = parseUrl(req.url)\n parsed.pathname = parsedUrl.pathname\n req.url = formatUrl(parsed)\n }\n\n return false\n }\n\n private handleNextDataRequest: RouteHandler =\n async (req, res, parsedUrl) => {\n const middleware = await this.getMiddleware()\n const params = matchNextDataPathname(parsedUrl.pathname)\n\n // ignore for non-next data URLs\n if (!params || !params.path) {\n return false\n }\n\n if (params.path[0] !== this.buildId) {\n // Ignore if its a middleware request when we aren't on edge.\n if (getRequestMeta(req, 'middlewareInvoke')) {\n return false\n }\n\n // Make sure to 404 if the buildId isn't correct\n await this.render404(req, res, parsedUrl)\n return true\n }\n\n // remove buildId from URL\n params.path.shift()\n\n const lastParam = params.path[params.path.length - 1]\n\n // show 404 if it doesn't end with .json\n if (typeof lastParam !== 'string' || !lastParam.endsWith('.json')) {\n await this.render404(req, res, parsedUrl)\n return true\n }\n\n // re-create page's pathname\n let pathname = `/${params.path.join('/')}`\n pathname = getRouteFromAssetPath(pathname, '.json')\n\n // ensure trailing slash is normalized per config\n if (middleware) {\n if (this.nextConfig.trailingSlash && !pathname.endsWith('/')) {\n pathname += '/'\n }\n if (\n !this.nextConfig.trailingSlash &&\n pathname.length > 1 &&\n pathname.endsWith('/')\n ) {\n pathname = pathname.substring(0, pathname.length - 1)\n }\n }\n\n if (this.i18nProvider) {\n // Remove the port from the hostname if present.\n const hostname = req?.headers.host?.split(':', 1)[0].toLowerCase()\n\n const domainLocale = this.i18nProvider.detectDomainLocale(hostname)\n const defaultLocale =\n domainLocale?.defaultLocale ?? this.i18nProvider.config.defaultLocale\n\n const localePathResult = this.i18nProvider.analyze(pathname)\n\n // If the locale is detected from the path, we need to remove it\n // from the pathname.\n if (localePathResult.detectedLocale) {\n pathname = localePathResult.pathname\n }\n\n // Update the query with the detected locale and default locale.\n addRequestMeta(req, 'locale', localePathResult.detectedLocale)\n addRequestMeta(req, 'defaultLocale', defaultLocale)\n\n // If the locale is not detected from the path, we need to mark that\n // it was not inferred from default.\n if (!localePathResult.detectedLocale) {\n removeRequestMeta(req, 'localeInferredFromDefault')\n }\n\n // If no locale was detected and we don't have middleware, we need\n // to render a 404 page.\n if (!localePathResult.detectedLocale && !middleware) {\n addRequestMeta(req, 'locale', defaultLocale)\n await this.render404(req, res, parsedUrl)\n return true\n }\n }\n\n parsedUrl.pathname = pathname\n addRequestMeta(req, 'isNextDataReq', true)\n\n return false\n }\n\n protected handleNextImageRequest: RouteHandler<\n ServerRequest,\n ServerResponse\n > = () => false\n\n protected handleCatchallRenderRequest: RouteHandler<\n ServerRequest,\n ServerResponse\n > = () => false\n\n protected handleCatchallMiddlewareRequest: RouteHandler<\n ServerRequest,\n ServerResponse\n > = () => false\n\n protected getRouteMatchers(): RouteMatcherManager {\n // Create a new manifest loader that get's the manifests from the server.\n const manifestLoader = new ServerManifestLoader((name) => {\n switch (name) {\n case PAGES_MANIFEST:\n return this.getPagesManifest() ?? null\n case APP_PATHS_MANIFEST:\n return this.getAppPathsManifest() ?? null\n default:\n return null\n }\n })\n\n // Configure the matchers and handlers.\n const matchers: RouteMatcherManager = new DefaultRouteMatcherManager()\n\n // Match pages under `pages/`.\n matchers.push(\n new PagesRouteMatcherProvider(\n this.distDir,\n manifestLoader,\n this.i18nProvider\n )\n )\n\n // Match api routes under `pages/api/`.\n matchers.push(\n new PagesAPIRouteMatcherProvider(\n this.distDir,\n manifestLoader,\n this.i18nProvider\n )\n )\n\n // If the app directory is enabled, then add the app matchers and handlers.\n if (this.enabledDirectories.app) {\n // Match app pages under `app/`.\n matchers.push(\n new AppPageRouteMatcherProvider(this.distDir, manifestLoader)\n )\n matchers.push(\n new AppRouteRouteMatcherProvider(this.distDir, manifestLoader)\n )\n }\n\n return matchers\n }\n\n protected async instrumentationOnRequestError(\n ...args: Parameters\n ) {\n const [err, req, ctx] = args\n\n if (this.instrumentation) {\n try {\n await this.instrumentation.onRequestError?.(\n err,\n {\n path: req.url || '',\n method: req.method || 'GET',\n // Normalize middleware headers and other server request headers\n headers:\n req instanceof NextRequestHint\n ? Object.fromEntries(req.headers.entries())\n : req.headers,\n },\n ctx\n )\n } catch (handlerErr) {\n // Log the soft error and continue, since errors can thrown from react stream handler\n console.error('Error in instrumentation.onRequestError:', handlerErr)\n }\n }\n }\n\n public logError(err: Error): void {\n if (this.quiet) return\n Log.error(err)\n }\n\n public async handleRequest(\n req: ServerRequest,\n res: ServerResponse,\n parsedUrl?: NextUrlWithParsedQuery\n ): Promise {\n await this.prepare()\n const method = req.method.toUpperCase()\n\n const tracer = getTracer()\n return tracer.withPropagatedContext(req.headers, () => {\n return tracer.trace(\n BaseServerSpan.handleRequest,\n {\n spanName: `${method} ${req.url}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url,\n },\n },\n async (span) =>\n this.handleRequestImpl(req, res, parsedUrl).finally(() => {\n if (!span) return\n\n const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? false\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': isRSCRequest,\n })\n\n if (res.statusCode && res.statusCode >= 500) {\n // For 5xx status codes: SHOULD be set to 'Error' span status.\n // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status\n span.setStatus({\n code: SpanStatusCode.ERROR,\n })\n // For span status 'Error', SHOULD set 'error.type' attribute.\n span.setAttribute('error.type', res.statusCode.toString())\n }\n\n const rootSpanAttributes = tracer.getRootSpanAttributes()\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) return\n\n if (\n rootSpanAttributes.get('next.span_type') !==\n BaseServerSpan.handleRequest\n ) {\n console.warn(\n `Unexpected root span type '${rootSpanAttributes.get(\n 'next.span_type'\n )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n )\n return\n }\n\n const route = rootSpanAttributes.get('next.route')\n if (route) {\n const name = isRSCRequest\n ? `RSC ${method} ${route}`\n : `${method} ${route}`\n\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name,\n })\n span.updateName(name)\n } else {\n span.updateName(\n isRSCRequest\n ? `RSC ${method} ${req.url}`\n : `${method} ${req.url}`\n )\n }\n })\n )\n })\n }\n\n private async handleRequestImpl(\n req: ServerRequest,\n res: ServerResponse,\n parsedUrl?: NextUrlWithParsedQuery\n ): Promise {\n try {\n // Wait for the matchers to be ready.\n await this.matchers.waitTillReady()\n\n // ensure cookies set in middleware are merged and\n // not overridden by API routes/getServerSideProps\n patchSetHeaderWithCookieSupport(\n req,\n isNodeNextResponse(res) ? res.originalResponse : res\n )\n\n const urlParts = (req.url || '').split('?', 1)\n const urlNoQuery = urlParts[0]\n\n // this normalizes repeated slashes in the path e.g. hello//world ->\n // hello/world or backslashes to forward slashes, this does not\n // handle trailing slash as that is handled the same as a next.config.js\n // redirect\n if (urlNoQuery?.match(/(\\\\|\\/\\/)/)) {\n const cleanUrl = normalizeRepeatedSlashes(req.url!)\n res.redirect(cleanUrl, 308).body(cleanUrl).send()\n return\n }\n\n // Parse url if parsedUrl not provided\n if (!parsedUrl || typeof parsedUrl !== 'object') {\n if (!req.url) {\n throw new Error('Invariant: url can not be undefined')\n }\n\n parsedUrl = parseUrl(req.url!, true)\n }\n\n if (!parsedUrl.pathname) {\n throw new Error(\"Invariant: pathname can't be empty\")\n }\n\n // Parse the querystring ourselves if the user doesn't handle querystring parsing\n if (typeof parsedUrl.query === 'string') {\n parsedUrl.query = Object.fromEntries(\n new URLSearchParams(parsedUrl.query)\n )\n }\n\n // Update the `x-forwarded-*` headers.\n const { originalRequest = null } = isNodeNextRequest(req) ? req : {}\n const xForwardedProto = originalRequest?.headers['x-forwarded-proto']\n const isHttps = xForwardedProto\n ? xForwardedProto === 'https'\n : !!(originalRequest?.socket as TLSSocket)?.encrypted\n\n req.headers['x-forwarded-host'] ??= req.headers['host'] ?? this.hostname\n req.headers['x-forwarded-port'] ??= this.port\n ? this.port.toString()\n : isHttps\n ? '443'\n : '80'\n req.headers['x-forwarded-proto'] ??= isHttps ? 'https' : 'http'\n req.headers['x-forwarded-for'] ??= originalRequest?.socket?.remoteAddress\n\n // This should be done before any normalization of the pathname happens as\n // it captures the initial URL.\n this.attachRequestMeta(req, parsedUrl)\n\n let finished = await this.handleRSCRequest(req, res, parsedUrl)\n if (finished) return\n\n const domainLocale = this.i18nProvider?.detectDomainLocale(\n getHostname(parsedUrl, req.headers)\n )\n\n const defaultLocale =\n domainLocale?.defaultLocale || this.nextConfig.i18n?.defaultLocale\n addRequestMeta(req, 'defaultLocale', defaultLocale)\n\n const url = parseUrlUtil(req.url.replace(/^\\/+/, '/'))\n const pathnameInfo = getNextPathnameInfo(url.pathname, {\n nextConfig: this.nextConfig,\n i18nProvider: this.i18nProvider,\n })\n url.pathname = pathnameInfo.pathname\n\n if (pathnameInfo.basePath) {\n req.url = removePathPrefix(req.url!, this.nextConfig.basePath)\n }\n\n const useMatchedPathHeader =\n this.minimalMode && typeof req.headers[MATCHED_PATH_HEADER] === 'string'\n\n // TODO: merge handling with invokePath\n if (useMatchedPathHeader) {\n try {\n if (this.enabledDirectories.app) {\n // ensure /index path is normalized for prerender\n // in minimal mode\n if (req.url.match(/^\\/index($|\\?)/)) {\n req.url = req.url.replace(/^\\/index/, '/')\n }\n parsedUrl.pathname =\n parsedUrl.pathname === '/index' ? '/' : parsedUrl.pathname\n }\n\n // x-matched-path is the source of truth, it tells what page\n // should be rendered because we don't process rewrites in minimalMode\n let { pathname: matchedPath } = new URL(\n fixMojibake(req.headers[MATCHED_PATH_HEADER] as string),\n 'http://localhost'\n )\n\n let { pathname: urlPathname } = new URL(req.url, 'http://localhost')\n\n // For ISR the URL is normalized to the prerenderPath so if\n // it's a data request the URL path will be the data URL,\n // basePath is already stripped by this point\n if (this.normalizers.data?.match(urlPathname)) {\n addRequestMeta(req, 'isNextDataReq', true)\n }\n // In minimal mode, if PPR is enabled, then we should check to see if\n // the request should be a resume request.\n else if (\n this.isAppPPREnabled &&\n this.minimalMode &&\n req.headers[NEXT_RESUME_HEADER] === '1' &&\n req.method === 'POST'\n ) {\n // Decode the postponed state from the request body, it will come as\n // an array of buffers, so collect them and then concat them to form\n // the string.\n const body: Array = []\n for await (const chunk of req.body) {\n body.push(chunk)\n }\n const postponed = Buffer.concat(body).toString('utf8')\n\n addRequestMeta(req, 'postponed', postponed)\n }\n\n matchedPath = this.normalize(matchedPath)\n const normalizedUrlPath = this.stripNextDataPath(urlPathname)\n\n matchedPath = denormalizePagePath(matchedPath)\n\n // Perform locale detection and normalization.\n const localeAnalysisResult = this.i18nProvider?.analyze(matchedPath, {\n defaultLocale,\n })\n\n // The locale result will be defined even if the locale was not\n // detected for the request because it will be inferred from the\n // default locale.\n if (localeAnalysisResult) {\n addRequestMeta(req, 'locale', localeAnalysisResult.detectedLocale)\n\n // If the detected locale was inferred from the default locale, we\n // need to modify the metadata on the request to indicate that.\n if (localeAnalysisResult.inferredFromDefault) {\n addRequestMeta(req, 'localeInferredFromDefault', true)\n } else {\n removeRequestMeta(req, 'localeInferredFromDefault')\n }\n }\n\n let srcPathname = matchedPath\n let pageIsDynamic = isDynamicRoute(srcPathname)\n let paramsResult: {\n params: ParsedUrlQuery | false\n hasValidParams: boolean\n } = {\n params: false,\n hasValidParams: false,\n }\n\n if (!pageIsDynamic) {\n const match = await this.matchers.match(srcPathname, {\n i18n: localeAnalysisResult,\n })\n\n // Update the source pathname to the matched page's pathname.\n if (match) {\n srcPathname = match.definition.pathname\n\n // The page is dynamic if the params are defined. We know at this\n // stage that the matched path is not a static page if the params\n // were parsed from the matched path header.\n if (typeof match.params !== 'undefined') {\n pageIsDynamic = true\n paramsResult.params = match.params\n paramsResult.hasValidParams = true\n }\n }\n }\n\n // The rest of this function can't handle i18n properly, so ensure we\n // restore the pathname with the locale information stripped from it\n // now that we're done matching if we're using i18n.\n if (localeAnalysisResult) {\n matchedPath = localeAnalysisResult.pathname\n }\n\n const utils = getServerUtils({\n pageIsDynamic,\n page: srcPathname,\n i18n: this.nextConfig.i18n,\n basePath: this.nextConfig.basePath,\n rewrites: this.getRoutesManifest()?.rewrites || {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n },\n caseSensitive: !!this.nextConfig.experimental.caseSensitiveRoutes,\n })\n\n // Ensure parsedUrl.pathname includes locale before processing\n // rewrites or they won't match correctly.\n if (defaultLocale && !pathnameInfo.locale) {\n parsedUrl.pathname = `/${defaultLocale}${parsedUrl.pathname}`\n }\n\n // Store a copy of `parsedUrl.query` before calling handleRewrites.\n // Since `handleRewrites` might add new queries to `parsedUrl.query`.\n const originQueryParams = { ...parsedUrl.query }\n\n const pathnameBeforeRewrite = parsedUrl.pathname\n const rewriteParamKeys = Object.keys(\n utils.handleRewrites(req, parsedUrl)\n )\n\n // Create a copy of the query params to avoid mutating the original\n // object. This prevents any overlapping query params that have the\n // same normalized key from causing issues.\n const queryParams = { ...parsedUrl.query }\n const didRewrite = pathnameBeforeRewrite !== parsedUrl.pathname\n\n if (didRewrite && parsedUrl.pathname) {\n addRequestMeta(req, 'rewroteURL', parsedUrl.pathname)\n }\n\n const routeParamKeys = new Set()\n for (const [key, value] of Object.entries(parsedUrl.query)) {\n const normalizedKey = normalizeNextQueryParam(key)\n if (!normalizedKey) continue\n\n // Remove the prefixed key from the query params because we want\n // to consume it for the dynamic route matcher.\n delete parsedUrl.query[key]\n routeParamKeys.add(normalizedKey)\n\n if (typeof value === 'undefined') continue\n\n queryParams[normalizedKey] = Array.isArray(value)\n ? value.map((v) => decodeQueryPathParameter(v))\n : decodeQueryPathParameter(value)\n }\n\n // interpolate dynamic params and normalize URL if needed\n if (pageIsDynamic) {\n let params: ParsedUrlQuery | false = {}\n\n // If we don't already have valid params, try to parse them from\n // the query params.\n if (!paramsResult.hasValidParams) {\n paramsResult = utils.normalizeDynamicRouteParams(\n queryParams,\n false\n )\n }\n\n // for prerendered ISR paths we attempt parsing the route\n // params from the URL directly as route-matches may not\n // contain the correct values due to the filesystem path\n // matching before the dynamic route has been matched\n if (\n !paramsResult.hasValidParams &&\n !isDynamicRoute(normalizedUrlPath)\n ) {\n let matcherParams = utils.dynamicRouteMatcher?.(normalizedUrlPath)\n\n if (matcherParams) {\n utils.normalizeDynamicRouteParams(matcherParams, false)\n Object.assign(paramsResult.params, matcherParams)\n paramsResult.hasValidParams = true\n }\n }\n\n // if an action request is bypassing a prerender and we\n // don't have the params in the URL since it was prerendered\n // and matched during handle: 'filesystem' rather than dynamic route\n // resolving we need to parse the params from the matched-path.\n // Note: this is similar to above case but from match-path instead\n // of from the request URL since a rewrite could cause that to not\n // match the src pathname\n if (\n // we can have a collision with /index and a top-level /[slug]\n matchedPath !== '/index' &&\n !paramsResult.hasValidParams &&\n !isDynamicRoute(matchedPath)\n ) {\n let matcherParams = utils.dynamicRouteMatcher?.(matchedPath)\n\n if (matcherParams) {\n const curParamsResult = utils.normalizeDynamicRouteParams(\n matcherParams,\n false\n )\n\n if (curParamsResult.hasValidParams) {\n Object.assign(params, matcherParams)\n paramsResult = curParamsResult\n }\n }\n }\n\n if (paramsResult.hasValidParams) {\n params = paramsResult.params\n }\n\n const routeMatchesHeader = req.headers['x-now-route-matches']\n if (\n typeof routeMatchesHeader === 'string' &&\n routeMatchesHeader &&\n isDynamicRoute(matchedPath) &&\n !paramsResult.hasValidParams\n ) {\n const routeMatches =\n utils.getParamsFromRouteMatches(routeMatchesHeader)\n\n if (routeMatches) {\n paramsResult = utils.normalizeDynamicRouteParams(\n routeMatches,\n true\n )\n\n if (paramsResult.hasValidParams) {\n params = paramsResult.params\n }\n }\n }\n\n // Try to parse the params from the query if we couldn't parse them\n // from the route matches but ignore missing optional params.\n if (!paramsResult.hasValidParams) {\n paramsResult = utils.normalizeDynamicRouteParams(\n queryParams,\n true\n )\n\n if (paramsResult.hasValidParams) {\n params = paramsResult.params\n }\n }\n\n // If the pathname being requested is the same as the source\n // pathname, and we don't have valid params, we want to use the\n // default route matches.\n if (\n utils.defaultRouteMatches &&\n normalizedUrlPath === srcPathname &&\n !paramsResult.hasValidParams\n ) {\n params = utils.defaultRouteMatches\n\n // If the route matches header is an empty string, we want to\n // render a fallback shell. This is because we know this came from\n // a prerender (it has the header) but it's values were filtered\n // out (because the allowQuery was empty). If it was undefined\n // then we know that the request is hitting the lambda directly.\n if (routeMatchesHeader === '') {\n addRequestMeta(req, 'renderFallbackShell', true)\n }\n }\n\n if (params) {\n matchedPath = utils.interpolateDynamicPath(srcPathname, params)\n req.url = utils.interpolateDynamicPath(req.url!, params)\n\n // If the request is for a segment prefetch, we need to update the\n // segment prefetch request path to include the interpolated\n // params.\n let segmentPrefetchRSCRequest = getRequestMeta(\n req,\n 'segmentPrefetchRSCRequest'\n )\n if (\n segmentPrefetchRSCRequest &&\n isDynamicRoute(segmentPrefetchRSCRequest, false)\n ) {\n segmentPrefetchRSCRequest = utils.interpolateDynamicPath(\n segmentPrefetchRSCRequest,\n params\n )\n\n req.headers[NEXT_ROUTER_SEGMENT_PREFETCH_HEADER] =\n segmentPrefetchRSCRequest\n addRequestMeta(\n req,\n 'segmentPrefetchRSCRequest',\n segmentPrefetchRSCRequest\n )\n }\n }\n }\n\n if (pageIsDynamic || didRewrite) {\n utils.normalizeCdnUrl(req, [\n ...rewriteParamKeys,\n ...Object.keys(utils.defaultRouteRegex?.groups || {}),\n ])\n }\n // Remove the route `params` keys from `parsedUrl.query` if they are\n // not in the original query params.\n // If it's used in both route `params` and query `searchParams`, it should be kept.\n for (const key of routeParamKeys) {\n if (!(key in originQueryParams)) {\n delete parsedUrl.query[key]\n }\n }\n parsedUrl.pathname = matchedPath\n url.pathname = parsedUrl.pathname\n finished = await this.normalizeAndAttachMetadata(req, res, parsedUrl)\n if (finished) return\n } catch (err) {\n if (err instanceof DecodeError || err instanceof NormalizeError) {\n res.statusCode = 400\n return this.renderError(null, req, res, '/_error', {})\n }\n throw err\n }\n }\n\n addRequestMeta(req, 'isLocaleDomain', Boolean(domainLocale))\n\n if (pathnameInfo.locale) {\n req.url = formatUrl(url)\n addRequestMeta(req, 'didStripLocale', true)\n }\n\n // If we aren't in minimal mode or there is no locale in the query\n // string, add the locale to the query string.\n if (!this.minimalMode || !getRequestMeta(req, 'locale')) {\n // If the locale is in the pathname, add it to the query string.\n if (pathnameInfo.locale) {\n addRequestMeta(req, 'locale', pathnameInfo.locale)\n }\n // If the default locale is available, add it to the query string and\n // mark it as inferred rather than implicit.\n else if (defaultLocale) {\n addRequestMeta(req, 'locale', defaultLocale)\n addRequestMeta(req, 'localeInferredFromDefault', true)\n }\n }\n\n // set incremental cache to request meta so it can\n // be passed down for edge functions and the fetch disk\n // cache can be leveraged locally\n if (\n !(this.serverOptions as any).webServerConfig &&\n !getRequestMeta(req, 'incrementalCache')\n ) {\n const incrementalCache = await this.getIncrementalCache({\n requestHeaders: Object.assign({}, req.headers),\n })\n\n incrementalCache.resetRequestCache()\n addRequestMeta(req, 'incrementalCache', incrementalCache)\n // This is needed for pages router to leverage unstable_cache\n // TODO: re-work this handling to not use global and use a AsyncStore\n ;(globalThis as any).__incrementalCache = incrementalCache\n }\n\n const cacheHandlers = getCacheHandlers()\n\n if (cacheHandlers) {\n await Promise.all(\n [...cacheHandlers].map(async (cacheHandler) => {\n if ('refreshTags' in cacheHandler) {\n // Note: cacheHandler.refreshTags() is called lazily before the\n // first cache entry is retrieved. It allows us to skip the\n // refresh request if no caches are read at all.\n } else {\n const previouslyRevalidatedTags = getPreviouslyRevalidatedTags(\n req.headers,\n this.getPrerenderManifest().preview.previewModeId\n )\n\n await cacheHandler.receiveExpiredTags(\n ...previouslyRevalidatedTags\n )\n }\n })\n )\n }\n\n // set server components HMR cache to request meta so it can be passed\n // down for edge functions\n if (!getRequestMeta(req, 'serverComponentsHmrCache')) {\n addRequestMeta(\n req,\n 'serverComponentsHmrCache',\n this.getServerComponentsHmrCache()\n )\n }\n\n // when invokePath is specified we can short short circuit resolving\n // we only honor this header if we are inside of a render worker to\n // prevent external users coercing the routing path\n const invokePath = getRequestMeta(req, 'invokePath')\n const useInvokePath = !useMatchedPathHeader && invokePath\n\n if (useInvokePath) {\n const invokeStatus = getRequestMeta(req, 'invokeStatus')\n if (invokeStatus) {\n const invokeQuery = getRequestMeta(req, 'invokeQuery')\n\n if (invokeQuery) {\n Object.assign(parsedUrl.query, invokeQuery)\n }\n\n res.statusCode = invokeStatus\n let err: Error | null = getRequestMeta(req, 'invokeError') || null\n\n return this.renderError(err, req, res, '/_error', parsedUrl.query)\n }\n\n const parsedMatchedPath = new URL(invokePath || '/', 'http://n')\n const invokePathnameInfo = getNextPathnameInfo(\n parsedMatchedPath.pathname,\n {\n nextConfig: this.nextConfig,\n parseData: false,\n }\n )\n\n if (invokePathnameInfo.locale) {\n addRequestMeta(req, 'locale', invokePathnameInfo.locale)\n }\n\n if (parsedUrl.pathname !== parsedMatchedPath.pathname) {\n parsedUrl.pathname = parsedMatchedPath.pathname\n addRequestMeta(req, 'rewroteURL', invokePathnameInfo.pathname)\n }\n const normalizeResult = normalizeLocalePath(\n removePathPrefix(parsedUrl.pathname, this.nextConfig.basePath || ''),\n this.nextConfig.i18n?.locales\n )\n\n if (normalizeResult.detectedLocale) {\n addRequestMeta(req, 'locale', normalizeResult.detectedLocale)\n }\n parsedUrl.pathname = normalizeResult.pathname\n\n for (const key of Object.keys(parsedUrl.query)) {\n delete parsedUrl.query[key]\n }\n const invokeQuery = getRequestMeta(req, 'invokeQuery')\n\n if (invokeQuery) {\n Object.assign(parsedUrl.query, invokeQuery)\n }\n\n finished = await this.normalizeAndAttachMetadata(req, res, parsedUrl)\n if (finished) return\n\n await this.handleCatchallRenderRequest(req, res, parsedUrl)\n return\n }\n\n if (getRequestMeta(req, 'middlewareInvoke')) {\n finished = await this.normalizeAndAttachMetadata(req, res, parsedUrl)\n if (finished) return\n\n finished = await this.handleCatchallMiddlewareRequest(\n req,\n res,\n parsedUrl\n )\n if (finished) return\n\n const err = new Error()\n ;(err as any).result = {\n response: new Response(null, {\n headers: {\n 'x-middleware-next': '1',\n },\n }),\n }\n ;(err as any).bubble = true\n throw err\n }\n\n // This wasn't a request via the matched path or the invoke path, so\n // prepare for a legacy run by removing the base path.\n\n // ensure we strip the basePath when not using an invoke header\n if (!useMatchedPathHeader && pathnameInfo.basePath) {\n parsedUrl.pathname = removePathPrefix(\n parsedUrl.pathname,\n pathnameInfo.basePath\n )\n }\n\n res.statusCode = 200\n return await this.run(req, res, parsedUrl)\n } catch (err: any) {\n if (err instanceof NoFallbackError) {\n throw err\n }\n\n if (\n (err && typeof err === 'object' && err.code === 'ERR_INVALID_URL') ||\n err instanceof DecodeError ||\n err instanceof NormalizeError\n ) {\n res.statusCode = 400\n return this.renderError(null, req, res, '/_error', {})\n }\n\n if (\n this.minimalMode ||\n this.renderOpts.dev ||\n (isBubbledError(err) && err.bubble)\n ) {\n throw err\n }\n this.logError(getProperError(err))\n res.statusCode = 500\n res.body('Internal Server Error').send()\n }\n }\n\n /**\n * Normalizes a pathname without attaching any metadata from any matched\n * normalizer.\n *\n * @param pathname the pathname to normalize\n * @returns the normalized pathname\n */\n private normalize = (pathname: string) => {\n const normalizers: Array = []\n\n if (this.normalizers.data) {\n normalizers.push(this.normalizers.data)\n }\n\n // We have to put the segment prefetch normalizer before the RSC normalizer\n // because the RSC normalizer will match the prefetch RSC routes too.\n if (this.normalizers.segmentPrefetchRSC) {\n normalizers.push(this.normalizers.segmentPrefetchRSC)\n }\n\n // We have to put the prefetch normalizer before the RSC normalizer\n // because the RSC normalizer will match the prefetch RSC routes too.\n if (this.normalizers.prefetchRSC) {\n normalizers.push(this.normalizers.prefetchRSC)\n }\n\n if (this.normalizers.rsc) {\n normalizers.push(this.normalizers.rsc)\n }\n\n for (const normalizer of normalizers) {\n if (!normalizer.match(pathname)) continue\n\n return normalizer.normalize(pathname, true)\n }\n\n return pathname\n }\n\n private normalizeAndAttachMetadata: RouteHandler<\n ServerRequest,\n ServerResponse\n > = async (req, res, url) => {\n let finished = await this.handleNextImageRequest(req, res, url)\n if (finished) return true\n\n if (this.enabledDirectories.pages) {\n finished = await this.handleNextDataRequest(req, res, url)\n if (finished) return true\n }\n\n return false\n }\n\n /**\n * @internal - this method is internal to Next.js and should not be used directly by end-users\n */\n public getRequestHandlerWithMetadata(\n meta: RequestMeta\n ): BaseRequestHandler {\n const handler = this.getRequestHandler()\n return (req, res, parsedUrl) => {\n setRequestMeta(req, meta)\n return handler(req, res, parsedUrl)\n }\n }\n\n public getRequestHandler(): BaseRequestHandler<\n ServerRequest,\n ServerResponse\n > {\n return this.handleRequest.bind(this)\n }\n\n protected abstract handleUpgrade(\n req: ServerRequest,\n socket: any,\n head?: any\n ): Promise\n\n public setAssetPrefix(prefix?: string): void {\n this.nextConfig.assetPrefix = prefix ? prefix.replace(/\\/$/, '') : ''\n }\n\n protected prepared: boolean = false\n protected preparedPromise: Promise | null = null\n /**\n * Runs async initialization of server.\n * It is idempotent, won't fire underlying initialization more than once.\n */\n public async prepare(): Promise {\n if (this.prepared) return\n\n // Get instrumentation module\n if (!this.instrumentation) {\n this.instrumentation = await this.loadInstrumentationModule()\n }\n if (this.preparedPromise === null) {\n this.preparedPromise = this.prepareImpl().then(() => {\n this.prepared = true\n this.preparedPromise = null\n })\n }\n return this.preparedPromise\n }\n protected async prepareImpl(): Promise {}\n protected async loadInstrumentationModule(): Promise {}\n\n public async close(): Promise {}\n\n protected getAppPathRoutes(): Record {\n const appPathRoutes: Record = {}\n\n Object.keys(this.appPathsManifest || {}).forEach((entry) => {\n const normalizedPath = normalizeAppPath(entry)\n if (!appPathRoutes[normalizedPath]) {\n appPathRoutes[normalizedPath] = []\n }\n appPathRoutes[normalizedPath].push(entry)\n })\n return appPathRoutes\n }\n\n protected async run(\n req: ServerRequest,\n res: ServerResponse,\n parsedUrl: UrlWithParsedQuery\n ): Promise {\n return getTracer().trace(BaseServerSpan.run, async () =>\n this.runImpl(req, res, parsedUrl)\n )\n }\n\n private async runImpl(\n req: ServerRequest,\n res: ServerResponse,\n parsedUrl: UrlWithParsedQuery\n ): Promise {\n await this.handleCatchallRenderRequest(req, res, parsedUrl)\n }\n\n private async pipe(\n fn: (\n ctx: RequestContext\n ) => Promise,\n partialContext: Omit<\n RequestContext,\n 'renderOpts'\n >\n ): Promise {\n return getTracer().trace(BaseServerSpan.pipe, async () =>\n this.pipeImpl(fn, partialContext)\n )\n }\n\n private async pipeImpl(\n fn: (\n ctx: RequestContext\n ) => Promise,\n partialContext: Omit<\n RequestContext,\n 'renderOpts'\n >\n ): Promise {\n const ua = partialContext.req.headers['user-agent'] || ''\n\n const ctx: RequestContext = {\n ...partialContext,\n renderOpts: {\n ...this.renderOpts,\n // `renderOpts.botType` is accumulated in `this.renderImpl()`\n supportsDynamicResponse: !this.renderOpts.botType,\n serveStreamingMetadata: shouldServeStreamingMetadata(\n ua,\n this.nextConfig.htmlLimitedBots\n ),\n },\n }\n\n const payload = await fn(ctx)\n if (payload === null) {\n return\n }\n const { req, res } = ctx\n const originalStatus = res.statusCode\n const { body } = payload\n let { cacheControl } = payload\n if (!res.sent) {\n const { generateEtags, poweredByHeader, dev } = this.renderOpts\n\n // In dev, we should not cache pages for any reason.\n if (dev) {\n res.setHeader('Cache-Control', 'no-store, must-revalidate')\n cacheControl = undefined\n }\n\n if (cacheControl && cacheControl.expire === undefined) {\n cacheControl.expire = this.nextConfig.expireTime\n }\n\n await this.sendRenderResult(req, res, {\n result: body,\n generateEtags,\n poweredByHeader,\n cacheControl,\n })\n res.statusCode = originalStatus\n }\n }\n\n private async getStaticHTML(\n fn: (\n ctx: RequestContext\n ) => Promise,\n partialContext: Omit<\n RequestContext,\n 'renderOpts'\n >\n ): Promise {\n const ctx: RequestContext = {\n ...partialContext,\n renderOpts: {\n ...this.renderOpts,\n supportsDynamicResponse: false,\n },\n }\n const payload = await fn(ctx)\n if (payload === null) {\n return null\n }\n return payload.body.toUnchunkedString()\n }\n\n public async render(\n req: ServerRequest,\n res: ServerResponse,\n pathname: string,\n query: NextParsedUrlQuery = {},\n parsedUrl?: NextUrlWithParsedQuery,\n internalRender = false\n ): Promise {\n return getTracer().trace(BaseServerSpan.render, async () =>\n this.renderImpl(req, res, pathname, query, parsedUrl, internalRender)\n )\n }\n\n protected getWaitUntil(): WaitUntil | undefined {\n const builtinRequestContext = getBuiltinRequestContext()\n if (builtinRequestContext) {\n // the platform provided a request context.\n // use the `waitUntil` from there, whether actually present or not --\n // if not present, `after` will error.\n\n // NOTE: if we're in an edge runtime sandbox, this context will be used to forward the outer waitUntil.\n return builtinRequestContext.waitUntil\n }\n\n if (this.minimalMode) {\n // we're built for a serverless environment, and `waitUntil` is not available,\n // but using a noop would likely lead to incorrect behavior,\n // because we have no way of keeping the invocation alive.\n // return nothing, and `after` will error if used.\n //\n // NOTE: for edge functions, `NextWebServer` always runs in minimal mode.\n //\n // NOTE: if we're in an edge runtime sandbox, waitUntil will be passed in using \"@next/request-context\",\n // so we won't get here.\n return undefined\n }\n\n return this.getInternalWaitUntil()\n }\n\n protected getInternalWaitUntil(): WaitUntil | undefined {\n return undefined\n }\n\n private async renderImpl(\n req: ServerRequest,\n res: ServerResponse,\n pathname: string,\n query: NextParsedUrlQuery = {},\n parsedUrl?: NextUrlWithParsedQuery,\n internalRender = false\n ): Promise {\n if (!pathname.startsWith('/')) {\n console.warn(\n `Cannot render page with path \"${pathname}\", did you mean \"/${pathname}\"?. See more info here: https://nextjs.org/docs/messages/render-no-starting-slash`\n )\n }\n\n if (\n this.serverOptions.customServer &&\n pathname === '/index' &&\n !(await this.hasPage('/index'))\n ) {\n // maintain backwards compatibility for custom server\n // (see custom-server integration tests)\n pathname = '/'\n }\n\n const ua = req.headers['user-agent'] || ''\n this.renderOpts.botType = getBotType(ua)\n\n // we allow custom servers to call render for all URLs\n // so check if we need to serve a static _next file or not.\n // we don't modify the URL for _next/data request but still\n // call render so we special case this to prevent an infinite loop\n if (\n !internalRender &&\n !this.minimalMode &&\n !getRequestMeta(req, 'isNextDataReq') &&\n (req.url?.match(/^\\/_next\\//) ||\n (this.hasStaticDir && req.url!.match(/^\\/static\\//)))\n ) {\n return this.handleRequest(req, res, parsedUrl)\n }\n\n if (isBlockedPage(pathname)) {\n return this.render404(req, res, parsedUrl)\n }\n\n return this.pipe((ctx) => this.renderToResponse(ctx), {\n req,\n res,\n pathname,\n query,\n })\n }\n\n protected async getStaticPaths({\n pathname,\n }: {\n pathname: string\n urlPathname: string\n requestHeaders: import('./lib/incremental-cache').IncrementalCache['requestHeaders']\n page: string\n isAppPath: boolean\n }): Promise<{\n staticPaths?: string[]\n prerenderedRoutes?: PrerenderedRoute[]\n fallbackMode?: FallbackMode\n }> {\n // Read whether or not fallback should exist from the manifest.\n const fallbackField =\n this.getPrerenderManifest().dynamicRoutes[pathname]?.fallback\n\n return {\n // `staticPaths` is intentionally set to `undefined` as it should've\n // been caught when checking disk data.\n staticPaths: undefined,\n fallbackMode: parseFallbackField(fallbackField),\n }\n }\n\n private async renderToResponseWithComponents(\n requestContext: RequestContext,\n findComponentsResult: FindComponentsResult\n ): Promise {\n return getTracer().trace(\n BaseServerSpan.renderToResponseWithComponents,\n async () =>\n this.renderToResponseWithComponentsImpl(\n requestContext,\n findComponentsResult\n )\n )\n }\n\n protected pathCouldBeIntercepted(resolvedPathname: string): boolean {\n return (\n isInterceptionRouteAppPath(resolvedPathname) ||\n this.interceptionRoutePatterns.some((regexp) => {\n return regexp.test(resolvedPathname)\n })\n )\n }\n\n protected setVaryHeader(\n req: ServerRequest,\n res: ServerResponse,\n isAppPath: boolean,\n resolvedPathname: string\n ): void {\n const baseVaryHeader = `${RSC_HEADER}, ${NEXT_ROUTER_STATE_TREE_HEADER}, ${NEXT_ROUTER_PREFETCH_HEADER}, ${NEXT_ROUTER_SEGMENT_PREFETCH_HEADER}`\n const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? false\n\n let addedNextUrlToVary = false\n\n if (isAppPath && this.pathCouldBeIntercepted(resolvedPathname)) {\n // Interception route responses can vary based on the `Next-URL` header.\n // We use the Vary header to signal this behavior to the client to properly cache the response.\n res.appendHeader('vary', `${baseVaryHeader}, ${NEXT_URL}`)\n addedNextUrlToVary = true\n } else if (isAppPath || isRSCRequest) {\n // We don't need to include `Next-URL` in the Vary header for non-interception routes since it won't affect the response.\n // We also set this header for pages to avoid caching issues when navigating between pages and app.\n res.appendHeader('vary', baseVaryHeader)\n }\n\n if (!addedNextUrlToVary) {\n // Remove `Next-URL` from the request headers we determined it wasn't necessary to include in the Vary header.\n // This is to avoid any dependency on the `Next-URL` header being present when preparing the response.\n delete req.headers[NEXT_URL]\n }\n }\n\n private async renderToResponseWithComponentsImpl(\n {\n req,\n res,\n pathname,\n renderOpts: opts,\n }: RequestContext,\n { components, query }: FindComponentsResult\n ): Promise {\n if (pathname === UNDERSCORE_NOT_FOUND_ROUTE) {\n pathname = '/404'\n }\n const isErrorPathname = pathname === '/_error'\n const is404Page =\n pathname === '/404' || (isErrorPathname && res.statusCode === 404)\n const is500Page =\n pathname === '/500' || (isErrorPathname && res.statusCode === 500)\n const isAppPath = components.isAppPath === true\n\n const hasServerProps = !!components.getServerSideProps\n const isPossibleServerAction = getIsPossibleServerAction(req)\n let isSSG = !!components.getStaticProps\n // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later\n const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? false\n\n // Not all CDNs respect the Vary header when caching. We must assume that\n // only the URL is used to vary the responses. The Next client computes a\n // hash of the header values and sends it as a search param. Before\n // responding to a request, we must verify that the hash matches the\n // expected value. Neglecting to do this properly can lead to cache\n // poisoning attacks on certain CDNs.\n if (\n !this.minimalMode &&\n this.nextConfig.experimental.validateRSCRequestHeaders &&\n isRSCRequest\n ) {\n const headers = req.headers\n\n const prefetchHeaderValue = headers[NEXT_ROUTER_PREFETCH_HEADER]\n const routerPrefetch =\n prefetchHeaderValue !== undefined\n ? // We only recognize '1' and '2'. Strip all other values here.\n prefetchHeaderValue === '1' || prefetchHeaderValue === '2'\n ? prefetchHeaderValue\n : undefined\n : // For runtime prefetches, we always perform a dynamic request,\n // so we don't expect the header to be stripped by an intermediate layer.\n // This should only happen for static prefetches, so we only handle those here.\n getRequestMeta(req, 'isPrefetchRSCRequest')\n ? '1'\n : undefined\n\n const segmentPrefetchRSCRequest =\n headers[NEXT_ROUTER_SEGMENT_PREFETCH_HEADER] ||\n getRequestMeta(req, 'segmentPrefetchRSCRequest')\n\n const expectedHash = await computeCacheBustingSearchParam(\n routerPrefetch,\n segmentPrefetchRSCRequest,\n headers[NEXT_ROUTER_STATE_TREE_HEADER],\n headers[NEXT_URL]\n )\n const actualHash =\n getRequestMeta(req, 'cacheBustingSearchParam') ??\n new URL(req.url || '', 'http://localhost').searchParams.get(\n NEXT_RSC_UNION_QUERY\n )\n\n let matchesHash = expectedHash === actualHash\n if (!matchesHash && actualHash !== null) {\n // We'll fallback to checking the legacy hash format to support clients that do not have a secure context\n matchesHash =\n computeLegacyCacheBustingSearchParam(\n routerPrefetch,\n segmentPrefetchRSCRequest,\n headers[NEXT_ROUTER_STATE_TREE_HEADER],\n headers[NEXT_URL]\n ) === actualHash\n }\n\n if (!matchesHash) {\n // The hash sent by the client does not match the expected value.\n // Redirect to the URL with the correct cache-busting search param.\n // This prevents cache poisoning attacks on CDNs that don't respect Vary headers.\n // We continue to accept the legacy short hash for clients that still\n // generate the 5-character `_rsc` form.\n // Note: When no headers are present, expectedHash is empty string and client\n // must send `_rsc` param, otherwise actualHash is null and hash check fails.\n const url = new URL(req.url || '', 'http://localhost')\n setCacheBustingSearchParamWithHash(url, expectedHash)\n res.statusCode = 307\n res.setHeader('location', `${url.pathname}${url.search}`)\n res.body('').send()\n return null\n }\n }\n\n // Compute the iSSG cache key. We use the rewroteUrl since\n // pages with fallback: false are allowed to be rewritten to\n // and we need to look up the path by the rewritten path\n let urlPathname = parseUrl(req.url || '').pathname || '/'\n\n let resolvedUrlPathname = getRequestMeta(req, 'rewroteURL') || urlPathname\n\n this.setVaryHeader(req, res, isAppPath, resolvedUrlPathname)\n\n let staticPaths: string[] | undefined\n let hasFallback = false\n\n const prerenderManifest = this.getPrerenderManifest()\n\n if (\n hasFallback ||\n staticPaths?.includes(resolvedUrlPathname) ||\n // this signals revalidation in deploy environments\n // TODO: make this more generic\n req.headers['x-now-route-matches']\n ) {\n isSSG = true\n } else if (!this.renderOpts.dev) {\n isSSG ||= !!prerenderManifest.routes[toRoute(pathname)]\n }\n\n // Toggle whether or not this is a Data request\n const isNextDataRequest =\n !!(\n getRequestMeta(req, 'isNextDataReq') ||\n (req.headers['x-nextjs-data'] &&\n (this.serverOptions as any).webServerConfig)\n ) &&\n (isSSG || hasServerProps)\n\n // when we are handling a middleware prefetch and it doesn't\n // resolve to a static data route we bail early to avoid\n // unexpected SSR invocations\n if (\n !isSSG &&\n req.headers['x-middleware-prefetch'] &&\n !(is404Page || pathname === '/_error')\n ) {\n res.setHeader(MATCHED_PATH_HEADER, pathname)\n res.setHeader('x-middleware-skip', '1')\n res.setHeader(\n 'cache-control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n res.body('{}').send()\n return null\n }\n\n // normalize req.url for SSG paths as it is not exposed\n // to getStaticProps and the asPath should not expose /_next/data\n if (\n isSSG &&\n this.minimalMode &&\n req.headers[MATCHED_PATH_HEADER] &&\n req.url.startsWith('/_next/data')\n ) {\n req.url = this.stripNextDataPath(req.url)\n }\n\n const locale = getRequestMeta(req, 'locale')\n\n if (\n !!req.headers['x-nextjs-data'] &&\n (!res.statusCode || res.statusCode === 200)\n ) {\n res.setHeader(\n 'x-nextjs-matched-path',\n `${locale ? `/${locale}` : ''}${pathname}`\n )\n }\n\n let routeModule: RouteModule | undefined\n if (components.routeModule) {\n routeModule = components.routeModule\n }\n\n /**\n * If the route being rendered is an app page, and the ppr feature has been\n * enabled, then the given route _could_ support PPR.\n */\n const couldSupportPPR: boolean =\n this.isAppPPREnabled &&\n typeof routeModule !== 'undefined' &&\n isAppPageRouteModule(routeModule)\n\n // When enabled, this will allow the use of the `?__nextppronly` query to\n // enable debugging of the static shell.\n const hasDebugStaticShellQuery =\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' &&\n typeof query.__nextppronly !== 'undefined' &&\n couldSupportPPR\n\n // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the\n // prerender manifest and this is an app page.\n const isRoutePPREnabled: boolean =\n couldSupportPPR &&\n ((\n prerenderManifest.routes[pathname] ??\n prerenderManifest.dynamicRoutes[pathname]\n )?.renderingMode === 'PARTIALLY_STATIC' ||\n // Ideally we'd want to check the appConfig to see if this page has PPR\n // enabled or not, but that would require plumbing the appConfig through\n // to the server during development. We assume that the page supports it\n // but only during development.\n (hasDebugStaticShellQuery &&\n (this.renderOpts.dev === true ||\n this.experimentalTestProxy === true)))\n\n // If we're in minimal mode, then try to get the postponed information from\n // the request metadata. If available, use it for resuming the postponed\n // render.\n const minimalPostponed = isRoutePPREnabled\n ? getRequestMeta(req, 'postponed')\n : undefined\n\n // we need to ensure the status code if /404 is visited directly\n if (is404Page && !isNextDataRequest && !isRSCRequest) {\n res.statusCode = 404\n }\n\n // ensure correct status is set when visiting a status page\n // directly e.g. /500\n if (STATIC_STATUS_PAGES.includes(pathname)) {\n res.statusCode = parseInt(pathname.slice(1), 10)\n }\n\n if (\n // Server actions can use non-GET/HEAD methods.\n !isPossibleServerAction &&\n // Resume can use non-GET/HEAD methods.\n !minimalPostponed &&\n !is404Page &&\n !is500Page &&\n pathname !== '/_error' &&\n req.method !== 'HEAD' &&\n req.method !== 'GET' &&\n (typeof components.Component === 'string' || isSSG)\n ) {\n res.statusCode = 405\n res.setHeader('Allow', ['GET', 'HEAD'])\n res.body('Method Not Allowed').send()\n return null\n }\n\n // handle static page\n if (typeof components.Component === 'string') {\n return {\n body: RenderResult.fromStatic(\n components.Component,\n HTML_CONTENT_TYPE_HEADER\n ),\n }\n }\n\n // Ensure that if the `amp` query parameter is falsy that we remove it from\n // the query object. This ensures it won't be found by the `in` operator.\n if ('amp' in query && !query.amp) delete query.amp\n\n if (opts.supportsDynamicResponse === true) {\n const ua = req.headers['user-agent'] || ''\n const isBotRequest = isBot(ua)\n const isSupportedDocument =\n typeof components.Document?.getInitialProps !== 'function' ||\n // The built-in `Document` component also supports dynamic HTML for concurrent mode.\n NEXT_BUILTIN_DOCUMENT in components.Document\n\n // Disable dynamic HTML in cases that we know it won't be generated,\n // so that we can continue generating a cache key when possible.\n // TODO-APP: should the first render for a dynamic app path\n // be static so we can collect revalidate and populate the\n // cache if there are no dynamic data requirements\n opts.supportsDynamicResponse =\n !isSSG && !isBotRequest && !query.amp && isSupportedDocument\n }\n\n // In development, we always want to generate dynamic HTML.\n if (!isNextDataRequest && isAppPath && opts.dev) {\n opts.supportsDynamicResponse = true\n }\n\n if (isSSG && this.minimalMode && req.headers[MATCHED_PATH_HEADER]) {\n // the url value is already correct when the matched-path header is set\n resolvedUrlPathname = urlPathname\n }\n\n urlPathname = removeTrailingSlash(urlPathname)\n resolvedUrlPathname = removeTrailingSlash(resolvedUrlPathname)\n if (this.localeNormalizer) {\n resolvedUrlPathname = this.localeNormalizer.normalize(resolvedUrlPathname)\n }\n\n // remove /_next/data prefix from urlPathname so it matches\n // for direct page visit and /_next/data visit\n if (isNextDataRequest) {\n resolvedUrlPathname = this.stripNextDataPath(resolvedUrlPathname)\n urlPathname = this.stripNextDataPath(urlPathname)\n }\n\n // use existing incrementalCache instance if available\n const incrementalCache: import('./lib/incremental-cache').IncrementalCache =\n await this.getIncrementalCache({\n requestHeaders: Object.assign({}, req.headers),\n })\n\n // TODO: investigate, this is not safe across multiple concurrent requests\n incrementalCache.resetRequestCache()\n\n if (\n routeModule?.isDev &&\n isDynamicRoute(pathname) &&\n (components.getStaticPaths || isAppPath)\n ) {\n const pathsResults = await this.getStaticPaths({\n pathname,\n urlPathname,\n requestHeaders: req.headers,\n page: components.page,\n isAppPath,\n })\n if (isAppPath && this.nextConfig.experimental.cacheComponents) {\n if (pathsResults.prerenderedRoutes?.length) {\n let smallestFallbackRouteParams = null\n for (const route of pathsResults.prerenderedRoutes) {\n const fallbackRouteParams = route.fallbackRouteParams\n if (!fallbackRouteParams || fallbackRouteParams.length === 0) {\n // There are no fallback route params so we don't need to continue\n smallestFallbackRouteParams = null\n break\n }\n if (\n smallestFallbackRouteParams === null ||\n fallbackRouteParams.length < smallestFallbackRouteParams.length\n ) {\n smallestFallbackRouteParams = fallbackRouteParams\n }\n }\n if (smallestFallbackRouteParams) {\n const devValidatingFallbackParams = new Map(\n smallestFallbackRouteParams.map((v) => [v, ''])\n )\n addRequestMeta(\n req,\n 'devValidatingFallbackParams',\n devValidatingFallbackParams\n )\n }\n }\n }\n }\n\n // An OPTIONS request to a page handler is invalid.\n if (\n req.method === 'OPTIONS' &&\n !is404Page &&\n (!routeModule || !isAppRouteRouteModule(routeModule))\n ) {\n await sendResponse(req, res, new Response(null, { status: 400 }))\n return null\n }\n\n const request = isNodeNextRequest(req) ? req.originalRequest : req\n const response = isNodeNextResponse(res) ? res.originalResponse : res\n\n const parsedInitUrl = parseUrl(getRequestMeta(req, 'initURL') || req.url)\n let initPathname = parsedInitUrl.pathname || '/'\n\n for (const normalizer of [\n this.normalizers.segmentPrefetchRSC,\n this.normalizers.prefetchRSC,\n this.normalizers.rsc,\n ]) {\n if (normalizer?.match(initPathname)) {\n initPathname = normalizer.normalize(initPathname)\n }\n }\n\n // On minimal mode, the request url of dynamic route can be a\n // literal dynamic route ('/[slug]') instead of actual URL, so overwriting to initPathname\n // will transform back the resolved url to the dynamic route pathname.\n if (!(this.minimalMode && isErrorPathname)) {\n request.url = `${initPathname}${parsedInitUrl.search || ''}`\n }\n\n // propagate the request context for dev\n setRequestMeta(request, getRequestMeta(req))\n addRequestMeta(request, 'distDir', this.distDir)\n addRequestMeta(request, 'query', query)\n addRequestMeta(request, 'params', opts.params)\n addRequestMeta(request, 'ampValidator', this.renderOpts.ampValidator)\n addRequestMeta(request, 'minimalMode', this.minimalMode)\n\n if (opts.err) {\n addRequestMeta(request, 'invokeError', opts.err)\n }\n\n const handler: (\n req: ServerRequest | IncomingMessage,\n res: ServerResponse | HTTPServerResponse,\n ctx: {\n waitUntil: ReturnType\n }\n ) => Promise = components.ComponentMod.handler\n\n const maybeDevRequest =\n // we need to capture fetch metrics when they are set\n // and can't wait for handler to resolve as the fetch\n // metrics are logged on response close which happens\n // before handler resolves\n process.env.NODE_ENV === 'development'\n ? new Proxy(request, {\n get(target: any, prop) {\n if (typeof target[prop] === 'function') {\n return target[prop].bind(target)\n }\n return target[prop]\n },\n set(target: any, prop, value) {\n if (prop === 'fetchMetrics') {\n ;(req as any).fetchMetrics = value\n }\n target[prop] = value\n return true\n },\n })\n : request\n\n await handler(maybeDevRequest, response, {\n waitUntil: this.getWaitUntil(),\n })\n\n // response is handled fully in handler\n return null\n }\n\n private stripNextDataPath(path: string, stripLocale = true) {\n if (path.includes(this.buildId)) {\n const splitPath = path.substring(\n path.indexOf(this.buildId) + this.buildId.length\n )\n\n path = denormalizePagePath(splitPath.replace(/\\.json$/, ''))\n }\n\n if (this.localeNormalizer && stripLocale) {\n return this.localeNormalizer.normalize(path)\n }\n return path\n }\n\n // map the route to the actual bundle name\n protected getOriginalAppPaths(route: string) {\n if (this.enabledDirectories.app) {\n const originalAppPath = this.appPathRoutes?.[route]\n\n if (!originalAppPath) {\n return null\n }\n\n return originalAppPath\n }\n return null\n }\n\n protected async renderPageComponent(\n ctx: RequestContext,\n bubbleNoFallback: boolean\n ) {\n const { query, pathname } = ctx\n\n const appPaths = this.getOriginalAppPaths(pathname)\n const isAppPath = Array.isArray(appPaths)\n\n let page = pathname\n if (isAppPath) {\n // the last item in the array is the root page, if there are parallel routes\n page = appPaths[appPaths.length - 1]\n }\n\n const result = await this.findPageComponents({\n locale: getRequestMeta(ctx.req, 'locale'),\n page,\n query,\n params: ctx.renderOpts.params || {},\n isAppPath,\n sriEnabled: !!this.nextConfig.experimental.sri?.algorithm,\n appPaths,\n // Ensuring for loading page component routes is done via the matcher.\n shouldEnsure: false,\n })\n if (result) {\n getTracer().setRootSpanAttribute('next.route', pathname)\n try {\n return await this.renderToResponseWithComponents(ctx, result)\n } catch (err) {\n const isNoFallbackError = err instanceof NoFallbackError\n\n if (!isNoFallbackError || (isNoFallbackError && bubbleNoFallback)) {\n throw err\n }\n }\n }\n return false\n }\n\n private async renderToResponse(\n ctx: RequestContext\n ): Promise {\n return getTracer().trace(\n BaseServerSpan.renderToResponse,\n {\n spanName: `rendering page`,\n attributes: {\n 'next.route': ctx.pathname,\n },\n },\n async () => {\n return this.renderToResponseImpl(ctx)\n }\n )\n }\n\n protected abstract getMiddleware(): Promise\n protected abstract getFallbackErrorComponents(\n url?: string\n ): Promise\n protected abstract getRoutesManifest(): NormalizedRouteManifest | undefined\n\n private async renderToResponseImpl(\n ctx: RequestContext\n ): Promise {\n const { req, res, query, pathname } = ctx\n let page = pathname\n const bubbleNoFallback =\n getRequestMeta(ctx.req, 'bubbleNoFallback') ?? false\n\n if (\n !this.minimalMode &&\n this.nextConfig.experimental.validateRSCRequestHeaders\n ) {\n addRequestMeta(\n ctx.req,\n 'cacheBustingSearchParam',\n query[NEXT_RSC_UNION_QUERY]\n )\n }\n delete query[NEXT_RSC_UNION_QUERY]\n\n const options: MatchOptions = {\n i18n: this.i18nProvider?.fromRequest(req, pathname),\n }\n\n try {\n for await (const match of this.matchers.matchAll(pathname, options)) {\n // when a specific invoke-output is meant to be matched\n // ensure a prior dynamic route/page doesn't take priority\n const invokeOutput = getRequestMeta(ctx.req, 'invokeOutput')\n if (\n !this.minimalMode &&\n typeof invokeOutput === 'string' &&\n isDynamicRoute(invokeOutput || '') &&\n invokeOutput !== match.definition.pathname\n ) {\n continue\n }\n\n const result = await this.renderPageComponent(\n {\n ...ctx,\n pathname: match.definition.pathname,\n renderOpts: {\n ...ctx.renderOpts,\n params: match.params,\n },\n },\n bubbleNoFallback\n )\n if (result !== false) return result\n }\n\n // currently edge functions aren't receiving the x-matched-path\n // header so we need to fallback to matching the current page\n // when we weren't able to match via dynamic route to handle\n // the rewrite case\n // @ts-expect-error extended in child class web-server\n if (this.serverOptions.webServerConfig) {\n // @ts-expect-error extended in child class web-server\n ctx.pathname = this.serverOptions.webServerConfig.page\n const result = await this.renderPageComponent(ctx, bubbleNoFallback)\n if (result !== false) return result\n }\n } catch (error) {\n const err = getProperError(error)\n\n if (error instanceof MissingStaticPage) {\n console.error(\n 'Invariant: failed to load static page',\n JSON.stringify(\n {\n page,\n url: ctx.req.url,\n matchedPath: ctx.req.headers[MATCHED_PATH_HEADER],\n initUrl: getRequestMeta(ctx.req, 'initURL'),\n didRewrite: !!getRequestMeta(ctx.req, 'rewroteURL'),\n rewroteUrl: getRequestMeta(ctx.req, 'rewroteURL'),\n },\n null,\n 2\n )\n )\n throw err\n }\n\n if (err instanceof NoFallbackError && bubbleNoFallback) {\n throw err\n }\n if (err instanceof DecodeError || err instanceof NormalizeError) {\n res.statusCode = 400\n return await this.renderErrorToResponse(ctx, err)\n }\n\n res.statusCode = 500\n\n // if pages/500 is present we still need to trigger\n // /_error `getInitialProps` to allow reporting error\n if (await this.hasPage('/500')) {\n addRequestMeta(ctx.req, 'customErrorRender', true)\n await this.renderErrorToResponse(ctx, err)\n removeRequestMeta(ctx.req, 'customErrorRender')\n }\n\n const isWrappedError = err instanceof WrappedBuildError\n\n if (!isWrappedError) {\n if (this.minimalMode || this.renderOpts.dev) {\n if (isError(err)) err.page = page\n throw err\n }\n this.logError(getProperError(err))\n }\n const response = await this.renderErrorToResponse(\n ctx,\n isWrappedError ? (err as WrappedBuildError).innerError : err\n )\n return response\n }\n\n const middleware = await this.getMiddleware()\n if (\n middleware &&\n !!ctx.req.headers['x-nextjs-data'] &&\n (!res.statusCode || res.statusCode === 200 || res.statusCode === 404)\n ) {\n const locale = getRequestMeta(req, 'locale')\n\n res.setHeader(\n 'x-nextjs-matched-path',\n `${locale ? `/${locale}` : ''}${pathname}`\n )\n res.statusCode = 200\n res.setHeader('Content-Type', JSON_CONTENT_TYPE_HEADER)\n res.body('{}')\n res.send()\n return null\n }\n\n res.statusCode = 404\n return this.renderErrorToResponse(ctx, null)\n }\n\n public async renderToHTML(\n req: ServerRequest,\n res: ServerResponse,\n pathname: string,\n query: ParsedUrlQuery = {}\n ): Promise {\n return getTracer().trace(BaseServerSpan.renderToHTML, async () => {\n return this.renderToHTMLImpl(req, res, pathname, query)\n })\n }\n\n private async renderToHTMLImpl(\n req: ServerRequest,\n res: ServerResponse,\n pathname: string,\n query: ParsedUrlQuery = {}\n ): Promise {\n return this.getStaticHTML((ctx) => this.renderToResponse(ctx), {\n req,\n res,\n pathname,\n query,\n })\n }\n\n public async renderError(\n err: Error | null,\n req: ServerRequest,\n res: ServerResponse,\n pathname: string,\n query: NextParsedUrlQuery = {},\n setHeaders = true\n ): Promise {\n return getTracer().trace(BaseServerSpan.renderError, async () => {\n return this.renderErrorImpl(err, req, res, pathname, query, setHeaders)\n })\n }\n\n private async renderErrorImpl(\n err: Error | null,\n req: ServerRequest,\n res: ServerResponse,\n pathname: string,\n query: NextParsedUrlQuery = {},\n setHeaders = true\n ): Promise {\n if (setHeaders) {\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n }\n\n return this.pipe(\n async (ctx) => {\n const response = await this.renderErrorToResponse(ctx, err)\n if (this.minimalMode && res.statusCode === 500) {\n throw err\n }\n return response\n },\n { req, res, pathname, query }\n )\n }\n\n private customErrorNo404Warn = execOnce(() => {\n Log.warn(\n `You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.\\nSee here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`\n )\n })\n\n private async renderErrorToResponse(\n ctx: RequestContext,\n err: Error | null\n ): Promise {\n return getTracer().trace(BaseServerSpan.renderErrorToResponse, async () => {\n return this.renderErrorToResponseImpl(ctx, err)\n })\n }\n\n protected async renderErrorToResponseImpl(\n ctx: RequestContext,\n err: Error | null\n ): Promise {\n // Short-circuit favicon.ico in development to avoid compiling 404 page when the app has no favicon.ico.\n // Since favicon.ico is automatically requested by the browser.\n if (this.renderOpts.dev && ctx.pathname === '/favicon.ico') {\n return {\n body: RenderResult.EMPTY,\n }\n }\n const { res, query } = ctx\n\n try {\n let result: null | FindComponentsResult = null\n\n const is404 = res.statusCode === 404\n let using404Page = false\n\n if (is404) {\n if (this.enabledDirectories.app) {\n // Use the not-found entry in app directory\n result = await this.findPageComponents({\n locale: getRequestMeta(ctx.req, 'locale'),\n page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n query,\n params: {},\n isAppPath: true,\n shouldEnsure: true,\n url: ctx.req.url,\n })\n using404Page = result !== null\n }\n\n if (!result && (await this.hasPage('/404'))) {\n result = await this.findPageComponents({\n locale: getRequestMeta(ctx.req, 'locale'),\n page: '/404',\n query,\n params: {},\n isAppPath: false,\n // Ensuring can't be done here because you never \"match\" a 404 route.\n shouldEnsure: true,\n url: ctx.req.url,\n })\n using404Page = result !== null\n }\n }\n let statusPage = `/${res.statusCode}`\n\n if (\n !getRequestMeta(ctx.req, 'customErrorRender') &&\n !result &&\n STATIC_STATUS_PAGES.includes(statusPage)\n ) {\n // skip ensuring /500 in dev mode as it isn't used and the\n // dev overlay is used instead\n if (statusPage !== '/500' || !this.renderOpts.dev) {\n result = await this.findPageComponents({\n locale: getRequestMeta(ctx.req, 'locale'),\n page: statusPage,\n query,\n params: {},\n isAppPath: false,\n // Ensuring can't be done here because you never \"match\" a 500\n // route.\n shouldEnsure: true,\n url: ctx.req.url,\n })\n }\n }\n\n if (!result) {\n result = await this.findPageComponents({\n locale: getRequestMeta(ctx.req, 'locale'),\n page: '/_error',\n query,\n params: {},\n isAppPath: false,\n // Ensuring can't be done here because you never \"match\" an error\n // route.\n shouldEnsure: true,\n url: ctx.req.url,\n })\n statusPage = '/_error'\n }\n\n if (\n process.env.NODE_ENV !== 'production' &&\n !using404Page &&\n (await this.hasPage('/_error')) &&\n !(await this.hasPage('/404'))\n ) {\n this.customErrorNo404Warn()\n }\n\n if (!result) {\n // this can occur when a project directory has been moved/deleted\n // which is handled in the parent process in development\n if (this.renderOpts.dev) {\n return {\n // wait for dev-server to restart before refreshing\n body: RenderResult.fromStatic(\n `\n
missing required error components, refreshing...
\n `,\n HTML_CONTENT_TYPE_HEADER\n ),\n }\n }\n\n throw new WrappedBuildError(\n new Error('missing required error components')\n )\n }\n\n // If the page has a route module, use it for the new match. If it doesn't\n // have a route module, remove the match.\n if (result.components.routeModule) {\n addRequestMeta(ctx.req, 'match', {\n definition: result.components.routeModule.definition,\n params: undefined,\n })\n } else {\n removeRequestMeta(ctx.req, 'match')\n }\n\n try {\n return await this.renderToResponseWithComponents(\n {\n ...ctx,\n pathname: statusPage,\n renderOpts: {\n ...ctx.renderOpts,\n err,\n },\n },\n result\n )\n } catch (maybeFallbackError) {\n if (maybeFallbackError instanceof NoFallbackError) {\n throw new Error('invariant: failed to render error page')\n }\n throw maybeFallbackError\n }\n } catch (error) {\n const renderToHtmlError = getProperError(error)\n const isWrappedError = renderToHtmlError instanceof WrappedBuildError\n if (!isWrappedError) {\n this.logError(renderToHtmlError)\n }\n res.statusCode = 500\n const fallbackComponents = await this.getFallbackErrorComponents(\n ctx.req.url\n )\n\n if (fallbackComponents) {\n // There was an error, so use it's definition from the route module\n // to add the match to the request.\n addRequestMeta(ctx.req, 'match', {\n definition: fallbackComponents.routeModule!.definition,\n params: undefined,\n })\n\n return this.renderToResponseWithComponents(\n {\n ...ctx,\n pathname: '/_error',\n renderOpts: {\n ...ctx.renderOpts,\n // We render `renderToHtmlError` here because `err` is\n // already captured in the stacktrace.\n err: isWrappedError\n ? renderToHtmlError.innerError\n : renderToHtmlError,\n },\n },\n {\n query,\n components: fallbackComponents,\n }\n )\n }\n return {\n body: RenderResult.fromStatic('Internal Server Error', 'text/plain'),\n }\n }\n }\n\n public async renderErrorToHTML(\n err: Error | null,\n req: ServerRequest,\n res: ServerResponse,\n pathname: string,\n query: ParsedUrlQuery = {}\n ): Promise {\n return this.getStaticHTML((ctx) => this.renderErrorToResponse(ctx, err), {\n req,\n res,\n pathname,\n query,\n })\n }\n\n public async render404(\n req: ServerRequest,\n res: ServerResponse,\n parsedUrl?: Pick,\n setHeaders = true\n ): Promise {\n const { pathname, query } = parsedUrl ? parsedUrl : parseUrl(req.url!, true)\n\n // Ensure the locales are provided on the request meta.\n if (this.nextConfig.i18n) {\n if (!getRequestMeta(req, 'locale')) {\n addRequestMeta(req, 'locale', this.nextConfig.i18n.defaultLocale)\n }\n addRequestMeta(req, 'defaultLocale', this.nextConfig.i18n.defaultLocale)\n }\n\n res.statusCode = 404\n return this.renderError(null, req, res, pathname!, query, setHeaders)\n }\n}\n"],"names":["WrappedBuildError","Server","Error","constructor","innerError","getServerComponentsHmrCache","nextConfig","experimental","serverComponentsHmrCache","globalThis","__serverComponentsHmrCache","undefined","options","handleRSCRequest","req","_res","parsedUrl","pathname","normalizers","segmentPrefetchRSC","match","result","extract","originalPathname","segmentPath","headers","RSC_HEADER","NEXT_ROUTER_PREFETCH_HEADER","NEXT_ROUTER_SEGMENT_PREFETCH_HEADER","addRequestMeta","prefetchRSC","normalize","rsc","stripFlightHeaders","isRSCRequestHeader","segmentPrefetchRSCRequest","url","parsed","parseUrl","formatUrl","handleNextDataRequest","res","middleware","getMiddleware","params","matchNextDataPathname","path","buildId","getRequestMeta","render404","shift","lastParam","length","endsWith","join","getRouteFromAssetPath","trailingSlash","substring","i18nProvider","hostname","host","split","toLowerCase","domainLocale","detectDomainLocale","defaultLocale","config","localePathResult","analyze","detectedLocale","removeRequestMeta","handleNextImageRequest","handleCatchallRenderRequest","handleCatchallMiddlewareRequest","data","push","normalizer","normalizeAndAttachMetadata","finished","enabledDirectories","pages","prepared","preparedPromise","customErrorNo404Warn","execOnce","Log","warn","dir","quiet","conf","dev","minimalMode","port","experimentalTestProxy","serverOptions","require","resolve","loadEnvConfig","fetchHostname","formatHostname","distDir","publicDir","getPublicDir","hasStaticDir","getHasStaticDir","i18n","locales","I18NProvider","localeNormalizer","LocaleRouteNormalizer","serverRuntimeConfig","publicRuntimeConfig","assetPrefix","generateEtags","getBuildId","minimalModeKey","process","env","NEXT_PRIVATE_MINIMAL_MODE","getEnabledDirectories","isAppPPREnabled","app","checkIsAppPPREnabled","ppr","isAppSegmentPrefetchEnabled","clientSegmentCache","RSCPathnameNormalizer","PrefetchRSCPathnameNormalizer","SegmentPrefixRSCPathnameNormalizer","NextDataPathnameNormalizer","nextFontManifest","getNextFontManifest","NEXT_DEPLOYMENT_ID","deploymentId","renderOpts","supportsDynamicResponse","poweredByHeader","canonicalBase","amp","previewProps","getPrerenderManifest","preview","ampOptimizerConfig","optimizer","basePath","images","optimizeCss","nextConfigOutput","output","nextScriptWorkers","disableOptimizedLoading","domainLocales","domains","serverComponents","cacheLifeProfiles","cacheLife","enableTainting","taint","crossOrigin","largePageDataBytes","runtimeConfig","Object","keys","isExperimentalCompile","htmlLimitedBots","expireTime","staleTimes","clientTraceMetadata","cacheComponents","Boolean","clientParamParsing","dynamicOnHover","inlineCss","authInterrupts","onInstrumentationRequestError","instrumentationOnRequestError","bind","reactMaxHeadersLength","devtoolSegmentExplorer","setConfig","pagesManifest","getPagesManifest","appPathsManifest","getAppPathsManifest","appPathRoutes","getAppPathRoutes","interceptionRoutePatterns","getinterceptionRoutePatterns","matchers","getRouteMatchers","reload","setAssetPrefix","responseCache","getResponseCache","manifestLoader","ServerManifestLoader","name","PAGES_MANIFEST","APP_PATHS_MANIFEST","DefaultRouteMatcherManager","PagesRouteMatcherProvider","PagesAPIRouteMatcherProvider","AppPageRouteMatcherProvider","AppRouteRouteMatcherProvider","args","err","ctx","instrumentation","onRequestError","method","NextRequestHint","fromEntries","entries","handlerErr","console","error","logError","handleRequest","prepare","toUpperCase","tracer","getTracer","withPropagatedContext","trace","BaseServerSpan","spanName","kind","SpanKind","SERVER","attributes","span","handleRequestImpl","finally","isRSCRequest","setAttributes","statusCode","setStatus","code","SpanStatusCode","ERROR","setAttribute","toString","rootSpanAttributes","getRootSpanAttributes","get","route","updateName","originalRequest","waitTillReady","patchSetHeaderWithCookieSupport","isNodeNextResponse","originalResponse","urlParts","urlNoQuery","cleanUrl","normalizeRepeatedSlashes","redirect","body","send","query","URLSearchParams","isNodeNextRequest","xForwardedProto","isHttps","socket","encrypted","remoteAddress","attachRequestMeta","getHostname","parseUrlUtil","replace","pathnameInfo","getNextPathnameInfo","removePathPrefix","useMatchedPathHeader","MATCHED_PATH_HEADER","matchedPath","URL","fixMojibake","urlPathname","NEXT_RESUME_HEADER","chunk","postponed","Buffer","concat","normalizedUrlPath","stripNextDataPath","denormalizePagePath","localeAnalysisResult","inferredFromDefault","srcPathname","pageIsDynamic","isDynamicRoute","paramsResult","hasValidParams","definition","utils","getServerUtils","page","rewrites","getRoutesManifest","beforeFiles","afterFiles","fallback","caseSensitive","caseSensitiveRoutes","locale","originQueryParams","pathnameBeforeRewrite","rewriteParamKeys","handleRewrites","queryParams","didRewrite","routeParamKeys","Set","key","value","normalizedKey","normalizeNextQueryParam","add","Array","isArray","map","v","decodeQueryPathParameter","normalizeDynamicRouteParams","matcherParams","dynamicRouteMatcher","assign","curParamsResult","routeMatchesHeader","routeMatches","getParamsFromRouteMatches","defaultRouteMatches","interpolateDynamicPath","normalizeCdnUrl","defaultRouteRegex","groups","DecodeError","NormalizeError","renderError","webServerConfig","incrementalCache","getIncrementalCache","requestHeaders","resetRequestCache","__incrementalCache","cacheHandlers","getCacheHandlers","Promise","all","cacheHandler","previouslyRevalidatedTags","getPreviouslyRevalidatedTags","previewModeId","receiveExpiredTags","invokePath","useInvokePath","invokeStatus","invokeQuery","parsedMatchedPath","invokePathnameInfo","parseData","normalizeResult","normalizeLocalePath","response","Response","bubble","run","NoFallbackError","isBubbledError","getProperError","getRequestHandlerWithMetadata","meta","handler","getRequestHandler","setRequestMeta","prefix","loadInstrumentationModule","prepareImpl","then","close","forEach","entry","normalizedPath","normalizeAppPath","runImpl","pipe","fn","partialContext","pipeImpl","ua","botType","serveStreamingMetadata","shouldServeStreamingMetadata","payload","originalStatus","cacheControl","sent","setHeader","expire","sendRenderResult","getStaticHTML","toUnchunkedString","render","internalRender","renderImpl","getWaitUntil","builtinRequestContext","getBuiltinRequestContext","waitUntil","getInternalWaitUntil","startsWith","customServer","hasPage","getBotType","isBlockedPage","renderToResponse","getStaticPaths","fallbackField","dynamicRoutes","staticPaths","fallbackMode","parseFallbackField","renderToResponseWithComponents","requestContext","findComponentsResult","renderToResponseWithComponentsImpl","pathCouldBeIntercepted","resolvedPathname","isInterceptionRouteAppPath","some","regexp","test","setVaryHeader","isAppPath","baseVaryHeader","NEXT_ROUTER_STATE_TREE_HEADER","addedNextUrlToVary","appendHeader","NEXT_URL","opts","components","prerenderManifest","UNDERSCORE_NOT_FOUND_ROUTE","isErrorPathname","is404Page","is500Page","hasServerProps","getServerSideProps","isPossibleServerAction","getIsPossibleServerAction","isSSG","getStaticProps","validateRSCRequestHeaders","prefetchHeaderValue","routerPrefetch","expectedHash","computeCacheBustingSearchParam","actualHash","searchParams","NEXT_RSC_UNION_QUERY","matchesHash","computeLegacyCacheBustingSearchParam","setCacheBustingSearchParamWithHash","search","resolvedUrlPathname","hasFallback","includes","routes","toRoute","isNextDataRequest","routeModule","couldSupportPPR","isAppPageRouteModule","hasDebugStaticShellQuery","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","__nextppronly","isRoutePPREnabled","renderingMode","minimalPostponed","STATIC_STATUS_PAGES","parseInt","slice","Component","RenderResult","fromStatic","HTML_CONTENT_TYPE_HEADER","isBotRequest","isBot","isSupportedDocument","Document","getInitialProps","NEXT_BUILTIN_DOCUMENT","removeTrailingSlash","isDev","pathsResults","prerenderedRoutes","smallestFallbackRouteParams","fallbackRouteParams","devValidatingFallbackParams","Map","isAppRouteRouteModule","sendResponse","status","request","parsedInitUrl","initPathname","ampValidator","ComponentMod","maybeDevRequest","NODE_ENV","Proxy","target","prop","set","fetchMetrics","stripLocale","splitPath","indexOf","getOriginalAppPaths","originalAppPath","renderPageComponent","bubbleNoFallback","appPaths","findPageComponents","sriEnabled","sri","algorithm","shouldEnsure","setRootSpanAttribute","isNoFallbackError","renderToResponseImpl","fromRequest","matchAll","invokeOutput","MissingStaticPage","JSON","stringify","initUrl","rewroteUrl","renderErrorToResponse","isWrappedError","isError","JSON_CONTENT_TYPE_HEADER","renderToHTML","renderToHTMLImpl","setHeaders","renderErrorImpl","renderErrorToResponseImpl","EMPTY","is404","using404Page","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","statusPage","maybeFallbackError","renderToHtmlError","fallbackComponents","getFallbackErrorComponents","renderErrorToHTML"],"mappings":";;;;;;;;;;;;;;;IA6RaA,iBAAiB;eAAjBA;;IAmBb,OAynFC;eAznF6BC;;;uBAtRvB;qBAqBgD;gCACxB;8BACI;2BAQ5B;wBACwB;uCACL;wBAEI;uBACI;qEACT;qCACW;qCACA;6DACf;6BACwC;iEACrB;6BAMjC;kCAC0B;0BACA;6BACL;0BACa;qCACL;kCAQ7B;uCAK+B;4CACK;6CACC;8CACC;8CACA;2CACH;sCACL;wBAM9B;4BACwB;8BACF;8BACA;wBACW;4BAMjC;qCAC6B;uCACE;8EACJ;qBACI;oCACH;wBAI5B;6BACuC;0BACH;yCACD;oCACC;yBACnB;yBAE8B;gCACN;qBACX;uCAI9B;yBACyB;0BAEsB;kCACH;mCACN;0CACJ;yCACT;0BACC;6BACL;4CACuB;yCAM5C;;;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