Actually print the port that was bound, instead of the one from the config (#644)

In the case of binding to port 0, this will print the actually bound port, instead of the `0` that's in the configuration file.

(cherry picked from commit d8a9c5223aefde72f3520c57582d6b41d4ad581c)
This commit is contained in:
TechnicJelle 2025-01-19 18:38:05 +01:00 committed by GitHub
parent b3dfc47e64
commit 9d13f59def
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,7 +55,7 @@ public void bind(SocketAddress address) throws IOException {
this.server.add(server);
if (checkIfBoundToAllInterfaces(address)) {
Logger.global.logInfo("WebServer bound to all network interfaces on port " + ((InetSocketAddress) address).getPort());
Logger.global.logInfo("WebServer bound to all network interfaces on port " + ((InetSocketAddress) server.getLocalAddress()).getPort());
} else {
Logger.global.logInfo("WebServer bound to: " + server.getLocalAddress());
}