mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Fix dns.resolve (#18393)
This commit is contained in:
@@ -2501,7 +2501,7 @@ pub const DNSResolver = struct {
|
||||
return globalThis.throwNotEnoughArguments("resolve", 3, arguments.len);
|
||||
}
|
||||
|
||||
const record_type: RecordType = if (arguments.len == 1)
|
||||
const record_type: RecordType = if (arguments.len <= 1)
|
||||
RecordType.default
|
||||
else brk: {
|
||||
const record_type_value = arguments.ptr[1];
|
||||
@@ -2518,7 +2518,7 @@ pub const DNSResolver = struct {
|
||||
}
|
||||
|
||||
break :brk RecordType.map.getWithEql(record_type_str.getZigString(globalThis), JSC.ZigString.eqlComptime) orelse {
|
||||
return globalThis.throwInvalidArgumentType("resolve", "record", "one of: A, AAAA, CAA, CNAME, MX, NS, PTR, SOA, SRV, TXT");
|
||||
return globalThis.throwInvalidArgumentType("resolve", "record", "one of: A, AAAA, ANY, CAA, CNAME, MX, NS, PTR, SOA, SRV, TXT");
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -395,7 +395,7 @@ var InternalResolver = class Resolver {
|
||||
validateResolve(hostname, callback);
|
||||
|
||||
Resolver.#getResolver(this)
|
||||
.resolve(hostname)
|
||||
.resolve(hostname, rrtype)
|
||||
.then(
|
||||
results => {
|
||||
switch (rrtype?.toLowerCase()) {
|
||||
|
||||
Reference in New Issue
Block a user