diff options
author | Linus Groh <mail@linusgroh.de> | 2021-05-30 14:11:53 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-30 14:11:53 +0100 |
commit | 75ea1bd3463577efbae98eb93496a6d27dcd8441 (patch) | |
tree | 7f2716cabb6c0bd5ecc4bf097b8a6779820dbf02 /Userland/Services | |
parent | 7fa3033ca817f6a8dda88a7fe091d9c61cd7b1aa (diff) | |
download | serenity-75ea1bd3463577efbae98eb93496a6d27dcd8441.zip |
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.
Diffstat (limited to 'Userland/Services')
-rw-r--r-- | Userland/Services/WebServer/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Services/WebServer/main.cpp b/Userland/Services/WebServer/main.cpp index e050424cb7..573f690fbc 100644 --- a/Userland/Services/WebServer/main.cpp +++ b/Userland/Services/WebServer/main.cpp @@ -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); |