Skip to content

Commit

Permalink
feature: check if valid port on server listening
Browse files Browse the repository at this point in the history
  • Loading branch information
Ando committed Aug 20, 2023
1 parent c191281 commit 469a605
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Check warning on line 45 in src/lib.rs

View workflow job for this annotation

GitHub Actions / lint

this expression creates a reference which is immediately dereferenced by the compiler

Check warning on line 45 in src/lib.rs

View workflow job for this annotation

GitHub Actions / lint

this expression creates a reference which is immediately dereferenced by the compiler
addr.push(':');
addr.push_str(&port.to_string());
Expand Down

0 comments on commit 469a605

Please sign in to comment.