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: #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
lemire authored Jun 7, 2023
1 parent 9c5efdd commit 077fd7d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions 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 077fd7d

Please sign in to comment.