-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: add missing to_ascii method in dns queries #48347
Conversation
Review requested:
|
auto wrap = std::make_unique<Wrap>(channel, req_wrap_obj); | ||
|
||
node::Utf8Value name(env->isolate(), string); | ||
auto plain_name = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure this code is safe because it appears that temporary objects are created, and they go out of scope. The result of node::Utf8Value is converted to a string_view, but a string_view pointing at what instance? It is unclear to me.
I recommend breaking this down...
Local<String> string = args[1].As<String>();
node::Utf8Value utf8name(env->isolate(), string);
std::string name = ada::idna::to_ascii(utf8name.ToStringView());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lemire Would you like to takeover this pull request? Unfortunately, I can't complete it soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing in favor of @lemire 's pull request |
Fixes #48262
cc @targos @ShogunPanda