diff options
author | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2022-01-07 19:24:40 +0300 |
---|---|---|
committer | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2022-04-12 06:50:09 +0300 |
commit | 3a26db9697a09915a0d541d97f047fc9c02bb452 (patch) | |
tree | 66359e4b009324215ec0915b44948a1501a10172 /src/tcp_wrap.cc | |
parent | 6706be1cdb676605a25d1a4b8dd0890fab62d73f (diff) |
net: make `server.address()` return an integer for `family`
`dns.lookup` options only accepts integer for `family` options,
having a string doesn't really make sense here.
PR-URL: https://github.com/nodejs/node/pull/41431
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'src/tcp_wrap.cc')
-rw-r--r-- | src/tcp_wrap.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index 538f0355491..747d3e028c2 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -380,7 +380,7 @@ MaybeLocal<Object> AddressToJS(Environment* env, OneByteString(env->isolate(), ip)).Check(); info->Set(env->context(), env->family_string(), - env->ipv6_string()).Check(); + Integer::New(env->isolate(), 6)).Check(); info->Set(env->context(), env->port_string(), Integer::New(env->isolate(), port)).Check(); @@ -395,7 +395,7 @@ MaybeLocal<Object> AddressToJS(Environment* env, OneByteString(env->isolate(), ip)).Check(); info->Set(env->context(), env->family_string(), - env->ipv4_string()).Check(); + Integer::New(env->isolate(), 4)).Check(); info->Set(env->context(), env->port_string(), Integer::New(env->isolate(), port)).Check(); |