mirror of
https://github.com/denoland/deno.git
synced 2024-11-30 16:40:57 -05:00
restore cares workaround for windows
This commit is contained in:
parent
cc3d7b2ca8
commit
ce620cecbb
1 changed files with 9 additions and 1 deletions
|
@ -36,6 +36,7 @@ import {
|
|||
} from "ext:deno_node/internal_binding/async_wrap.ts";
|
||||
import { ares_strerror } from "ext:deno_node/internal_binding/ares.ts";
|
||||
import { notImplemented } from "ext:deno_node/_utils.ts";
|
||||
import { isWindows } from "ext:deno_node/_util/os.ts";
|
||||
|
||||
interface LookupAddress {
|
||||
address: string;
|
||||
|
@ -67,7 +68,7 @@ export function getaddrinfo(
|
|||
_hints: number,
|
||||
verbatim: boolean,
|
||||
): number {
|
||||
const addresses: string[] = [];
|
||||
let addresses: string[] = [];
|
||||
|
||||
// TODO(cmorten): use hints
|
||||
// REF: https://nodejs.org/api/dns.html#dns_supported_getaddrinfo_flags
|
||||
|
@ -106,6 +107,13 @@ export function getaddrinfo(
|
|||
});
|
||||
}
|
||||
|
||||
// TODO(@bartlomieju): Forces IPv4 as a workaround for Deno not
|
||||
// aligning with Node on implicit binding on Windows
|
||||
// REF: https://github.com/denoland/deno/issues/10762
|
||||
if (isWindows && hostname === "localhost") {
|
||||
addresses = addresses.filter((address) => isIPv4(address));
|
||||
}
|
||||
|
||||
req.oncomplete(error, addresses);
|
||||
})();
|
||||
|
||||
|
|
Loading…
Reference in a new issue