File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { vi } from "vitest" ;
2+ import { normalizeHostname } from "../infra/net/hostname.js" ;
23import * as ssrf from "../infra/net/ssrf.js" ;
34import type { LookupFn } from "../infra/net/ssrf.js" ;
4- import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js" ;
55
66export function mockPinnedHostnameResolution ( addresses : string [ ] = [ "93.184.216.34" ] ) {
77 const resolvePinnedHostname = ssrf . resolvePinnedHostname ;
88 const resolvePinnedHostnameWithPolicy = ssrf . resolvePinnedHostnameWithPolicy ;
99 const lookupFn = ( async ( hostname : string , options ?: { all ?: boolean } ) => {
10- const normalized = normalizeLowercaseStringOrEmpty ( hostname ) . replace ( / \. $ / , "" ) ;
10+ const normalized = normalizeHostname ( hostname ) ;
1111 const resolved = addresses . map ( ( address ) => ( {
1212 address,
1313 family : address . includes ( ":" ) ? 6 : 4 ,
You can’t perform that action at this time.
0 commit comments