Unverified Commit b909772d authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[next/image] Stop using deprecated `url.parse` (#93208)

parent 5ccc1cc2
...@@ -7,7 +7,6 @@ import imageSizeOf from 'next/dist/compiled/image-size' ...@@ -7,7 +7,6 @@ import imageSizeOf from 'next/dist/compiled/image-size'
import { detector } from 'next/dist/compiled/image-detector/detector.js' import { detector } from 'next/dist/compiled/image-detector/detector.js'
import isAnimated from 'next/dist/compiled/is-animated' import isAnimated from 'next/dist/compiled/is-animated'
import { join } from 'path' import { join } from 'path'
import nodeUrl, { type UrlWithParsedQuery } from 'url'
import { getImageBlurSvg } from '../shared/lib/image-blur-svg' import { getImageBlurSvg } from '../shared/lib/image-blur-svg'
import type { ImageConfigComplete } from '../shared/lib/image-config' import type { ImageConfigComplete } from '../shared/lib/image-config'
...@@ -31,7 +30,7 @@ import * as Log from '../build/output/log' ...@@ -31,7 +30,7 @@ import * as Log from '../build/output/log'
import isError from '../lib/is-error' import isError from '../lib/is-error'
import { isPrivateIp } from './is-private-ip' import { isPrivateIp } from './is-private-ip'
import { getOrInitDiskLRU } from './lib/disk-lru-cache.external' import { getOrInitDiskLRU } from './lib/disk-lru-cache.external'
import { parseUrl } from '../lib/url' import { parseUrl, parseReqUrl } from '../lib/url'
import type { CacheControl } from './lib/cache-control' import type { CacheControl } from './lib/cache-control'
import { InvariantError } from '../shared/lib/invariant-error' import { InvariantError } from '../shared/lib/invariant-error'
import { lookup } from 'dns/promises' import { lookup } from 'dns/promises'
...@@ -380,7 +379,7 @@ export class ImageOptimizerCache { ...@@ -380,7 +379,7 @@ export class ImageOptimizerCache {
static validateParams( static validateParams(
req: IncomingMessage, req: IncomingMessage,
query: UrlWithParsedQuery['query'], query: NextUrlWithParsedQuery['query'],
nextConfig: NextConfigRuntime, nextConfig: NextConfigRuntime,
isDev: boolean isDev: boolean
): ImageParamsResult | { errorMessage: string } { ): ImageParamsResult | { errorMessage: string } {
...@@ -993,7 +992,7 @@ export async function fetchInternalImage( ...@@ -993,7 +992,7 @@ export async function fetchInternalImage(
maximumResponseBody, maximumResponseBody,
}) })
await handleRequest(mocked.req, mocked.res, nodeUrl.parse(href, true)) await handleRequest(mocked.req, mocked.res, parseReqUrl(href))
await mocked.res.hasStreamed await mocked.res.hasStreamed
if (!mocked.res.statusCode) { if (!mocked.res.statusCode) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment