From 2dd91f05294d22e9b8aadf2ab8260622eb4166d1 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Thu, 14 Sep 2023 15:34:13 +0200 Subject: [PATCH] Remove IncomingMessage type where unused --- packages/next/src/server/server-utils.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/packages/next/src/server/server-utils.ts b/packages/next/src/server/server-utils.ts index d723a56ad8b270..d602e6369254a6 100644 --- a/packages/next/src/server/server-utils.ts +++ b/packages/next/src/server/server-utils.ts @@ -19,7 +19,7 @@ import { normalizeRscPath } from '../shared/lib/router/utils/app-paths' import { NEXT_QUERY_PARAM_PREFIX } from '../lib/constants' export function normalizeVercelUrl( - req: BaseNextRequest | IncomingMessage, + req: BaseNextRequest, trustQuery: boolean, paramKeys?: string[], pageIsDynamic?: boolean, @@ -228,18 +228,8 @@ export function getUtils({ return rewriteParams } - function handleBasePath( - req: BaseNextRequest | IncomingMessage, - parsedUrl: UrlWithParsedQuery - ) { - // always strip the basePath if configured since it is required - req.url = req.url!.replace(new RegExp(`^${basePath}`), '') || '/' - parsedUrl.pathname = - parsedUrl.pathname!.replace(new RegExp(`^${basePath}`), '') || '/' - } - function getParamsFromRouteMatches( - req: BaseNextRequest | IncomingMessage, + req: BaseNextRequest, renderOpts?: any, detectedLocale?: string ) { @@ -418,14 +408,13 @@ export function getUtils({ return { handleRewrites, - handleBasePath, defaultRouteRegex, dynamicRouteMatcher, defaultRouteMatches, getParamsFromRouteMatches, normalizeDynamicRouteParams, normalizeVercelUrl: ( - req: BaseNextRequest | IncomingMessage, + req: BaseNextRequest, trustQuery: boolean, paramKeys?: string[] ) =>