From 469a605dcb15b88e0abb7fd5787336d9dc37f824 Mon Sep 17 00:00:00 2001 From: Ando Date: Sun, 20 Aug 2023 10:05:09 +0300 Subject: [PATCH] feature: check if valid port on server listening --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 9f21d49..7bc5909 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,6 +38,10 @@ pub mod server { panic!("An error occured, parameters need to be valid local host"); } + if !Params::is_valid_port(port) { + panic!("An error occured, parameters need to be valid local port"); + } + addr.push_str(&host); addr.push(':'); addr.push_str(&port.to_string());