mirror of
https://github.com/denoland/deno.git
synced 2025-03-04 01:44:26 -05:00
fix(ops/net): fix panic in op_dns_resolve (#9187)
This commit is contained in:
parent
ffb4b32e92
commit
0a159bea15
3 changed files with 9 additions and 1 deletions
|
@ -34,3 +34,9 @@ console.log(JSON.stringify(srv));
|
||||||
|
|
||||||
console.log("TXT");
|
console.log("TXT");
|
||||||
console.log(JSON.stringify(txt));
|
console.log(JSON.stringify(txt));
|
||||||
|
|
||||||
|
try {
|
||||||
|
await Deno.resolveDns("not-found-example.com", "A", nameServer);
|
||||||
|
} catch (e) {
|
||||||
|
console.log("Error thrown for not-found-example.com");
|
||||||
|
}
|
||||||
|
|
|
@ -14,3 +14,4 @@ SRV
|
||||||
[{"priority":0,"weight":100,"port":1234,"target":"srv.com."}]
|
[{"priority":0,"weight":100,"port":1234,"target":"srv.com."}]
|
||||||
TXT
|
TXT
|
||||||
[["foo","bar"]]
|
[["foo","bar"]]
|
||||||
|
Error thrown for not-found-example.com
|
||||||
|
|
|
@ -629,7 +629,8 @@ async fn op_dns_resolve(
|
||||||
|
|
||||||
let results: Vec<DnsReturnRecord> = resolver
|
let results: Vec<DnsReturnRecord> = resolver
|
||||||
.lookup(query, record_type, Default::default())
|
.lookup(query, record_type, Default::default())
|
||||||
.await?
|
.await
|
||||||
|
.map_err(|e| generic_error(format!("{}", e)))?
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(rdata_to_return_record(record_type))
|
.filter_map(rdata_to_return_record(record_type))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
Loading…
Add table
Reference in a new issue