Skip to content

Commit

Permalink
src: add missing to_ascii method in dns queries
Browse files Browse the repository at this point in the history
PR-URL: nodejs/node#48354
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
  • Loading branch information
sercher committed Apr 24, 2024
1 parent 162081d commit 0d11320
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions graal-nodejs/src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1414,9 +1414,11 @@ static void Query(const FunctionCallbackInfo<Value>& args) {
Local<String> string = args[1].As<String>();
auto wrap = std::make_unique<Wrap>(channel, req_wrap_obj);

node::Utf8Value name(env->isolate(), string);
node::Utf8Value utf8name(env->isolate(), string);
auto plain_name = utf8name.ToStringView();
std::string name = ada::idna::to_ascii(plain_name);
channel->ModifyActivityQueryCount(1);
int err = wrap->Send(*name);
int err = wrap->Send(name.c_str());
if (err) {
channel->ModifyActivityQueryCount(-1);
} else {
Expand Down

0 comments on commit 0d11320

Please sign in to comment.