Trim \r from command
This commit is contained in:
parent
6e6edfa2bd
commit
938e650592
1 changed files with 1 additions and 1 deletions
|
@ -112,7 +112,7 @@ fn handle_connection(mut stream: TcpStream) {
|
||||||
let mut request: &str =
|
let mut request: &str =
|
||||||
&String::from_utf8(buffer.to_vec()).expect("Failed to convert command to string");
|
&String::from_utf8(buffer.to_vec()).expect("Failed to convert command to string");
|
||||||
request = request.trim();
|
request = request.trim();
|
||||||
let trim_chars = [' ', '\n', '\0'];
|
let trim_chars = [' ', '\r', '\n', '\0'];
|
||||||
request = request.trim_matches(&trim_chars[..]);
|
request = request.trim_matches(&trim_chars[..]);
|
||||||
let mut command_iter = request.split_whitespace();
|
let mut command_iter = request.split_whitespace();
|
||||||
match command_iter.next() {
|
match command_iter.next() {
|
||||||
|
|
Loading…
Reference in a new issue