Skip to content

Commit afb9cb9

Browse files
lemireruyadorno
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 659c344 commit afb9cb9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cares_wrap.cc

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

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

0 commit comments

Comments
 (0)