WebServer: Exit when the given port is invalid

Similar to an invalid listen address, we should not fallback to the
default port (8000) but instead exit with an error.
This commit is contained in:
Linus Groh 2021-05-30 14:11:53 +01:00
parent 7fa3033ca8
commit 75ea1bd346
Notes: sideshowbarker 2024-07-18 17:10:22 +09:00

View File

@ -35,8 +35,8 @@ int main(int argc, char** argv)
}
if ((u16)port != port) {
outln("Warning: Invalid port number: {}", port);
port = default_port;
warnln("Invalid port number: {}", port);
return 1;
}
auto real_root_path = Core::File::real_path_for(root_path);