WebServer: Show the correct port when using port 0

Specifying port 0 on the command line causes WebServer to select a
random available port. We now show the port WebServer is actually
using rather than assuming it is the same as the command line argument.
This commit is contained in:
Tim Ledbetter 2023-06-20 19:21:49 +01:00 committed by Andreas Kling
parent e5685078c1
commit f02ccffaa8
Notes: sideshowbarker 2024-07-16 23:52:10 +09:00

View File

@ -96,8 +96,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(server->listen(ipv4_address.value(), port));
out("Listening on ");
out("\033]8;;http://{}:{}\033\\", ipv4_address.value(), port);
out("{}:{}", ipv4_address.value(), port);
out("\033]8;;http://{}:{}\033\\", ipv4_address.value(), server->local_port());
out("{}:{}", ipv4_address.value(), server->local_port());
outln("\033]8;;\033\\");
TRY(Core::System::unveil("/etc/timezone", "r"));