Skip to content

Commit 0a950c3

Browse files
lemiretargos
authored andcommitted
src: add missing to_ascii method in dns queries
PR-URL: #48354 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Paolo Insogna <[email protected]>
1 parent 284a869 commit 0a950c3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cares_wrap.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -1414,9 +1414,11 @@ static void Query(const FunctionCallbackInfo<Value>& args) {
14141414
Local<String> string = args[1].As<String>();
14151415
auto wrap = std::make_unique<Wrap>(channel, req_wrap_obj);
14161416

1417-
node::Utf8Value name(env->isolate(), string);
1417+
node::Utf8Value utf8name(env->isolate(), string);
1418+
auto plain_name = utf8name.ToStringView();
1419+
std::string name = ada::idna::to_ascii(plain_name);
14181420
channel->ModifyActivityQueryCount(1);
1419-
int err = wrap->Send(*name);
1421+
int err = wrap->Send(name.c_str());
14201422
if (err) {
14211423
channel->ModifyActivityQueryCount(-1);
14221424
} else {

0 commit comments

Comments
 (0)