Skip to content

Commit

Permalink
Remove IncomingMessage type where unused
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Sep 14, 2023
1 parent 129f56d commit 2dd91f0
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions packages/next/src/server/server-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
) {
Expand Down Expand Up @@ -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[]
) =>
Expand Down

0 comments on commit 2dd91f0

Please sign in to comment.