]> source.dussan.org Git - sonarqube.git/commit
SONAR-21971 Fix isLocal when multiple loopback adresses
authorJulien HENRY <julien.henry@sonarsource.com>
Tue, 2 Apr 2024 10:19:09 +0000 (12:19 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 3 Apr 2024 20:02:40 +0000 (20:02 +0000)
commitdda2bcce921549b20d7005e380dcc1bd5cdd6464
treebc7649b10d7d5c38c3a617c9ef3630d71b43b8c4
parent369eb731d47e5d6e2a9016f0d6db6f3c272b1c18
SONAR-21971 Fix isLocal when multiple loopback adresses

On my Ubuntu box, the hosts file contains:

$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 PC-L00XX

And InetAddress.getLocalHost() returns 127.0.1.1, so the test isLocal_returns_true_on_localhost_address_or_host was failing
server/sonar-process/src/main/java/org/sonar/process/NetworkUtilsImpl.java