hertz-contrib / registry

The service registration & discovery extensions for Hertz
Apache License 2.0
27 stars 39 forks source link

fix: fix ip is IsUnspecified #112

Open day253 opened 3 months ago

day253 commented 3 months ago

What type of PR is this?

fix: A bug fix

What this PR does / why we need it (English/Chinese):

When the host machine where the current instance is located does not support IPv6 addresses, the instance registration will use the IPv4 default address "0.0.0.0" for registration, resulting in the registered instance being "0.0.0.0" instead of the actual IP address.

// IsUnspecified reports whether ip is an unspecified address, either the IPv4 address "0.0.0.0" or the IPv6 address "::".

Which issue(s) this PR fixes:

day253 commented 3 months ago

It seems that this unit test won't pass even if the code remains unchanged.