From d4bcee663f35d8a172122cb36703c2aa6c615b8d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lievremont Date: Wed, 3 Feb 2021 11:49:21 +0100 Subject: [PATCH] SLLS-18 Listen only on loopback address --- .../sonarlint/ls/connected/SecurityHotspotsHandlerServer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/sonarsource/sonarlint/ls/connected/SecurityHotspotsHandlerServer.java b/src/main/java/org/sonarsource/sonarlint/ls/connected/SecurityHotspotsHandlerServer.java index f85f5f495..b623ee008 100644 --- a/src/main/java/org/sonarsource/sonarlint/ls/connected/SecurityHotspotsHandlerServer.java +++ b/src/main/java/org/sonarsource/sonarlint/ls/connected/SecurityHotspotsHandlerServer.java @@ -23,6 +23,7 @@ import com.google.gson.Gson; import java.io.IOException; import java.net.HttpURLConnection; +import java.net.InetAddress; import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; import java.util.Collections; @@ -95,6 +96,7 @@ public void init(String ideName, String clientVersion, @Nullable String workspac while(port < 0 && triedPort <= ENDING_PORT) { try { startedServer = ServerBootstrap.bootstrap() + .setLocalAddress(InetAddress.getLoopbackAddress()) .setListenerPort(triedPort) .setSocketConfig(socketConfig) .addFilterFirst("CORS", new CorsFilter())