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 <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
  • Loading branch information
lemire authored and ruyadorno committed Aug 29, 2023
1 parent 659c344 commit afb9cb9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cares_wrap.cc
Expand Up @@ -1413,9 +1413,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 afb9cb9

Please sign in to comment.