Skip to content

Commit 077fd7d

Browse files
authored
src: add missing to_ascii method in dns queries
PR-URL: #48354 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
1 parent 9c5efdd commit 077fd7d

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)