Browse Source

Allow addresses to be parsed without ports

develop
Drew Short 6 years ago
parent
commit
a0f86b4435
  1. 5
      src/server/api.rs

5
src/server/api.rs

@ -61,7 +61,10 @@ fn parse_remote_info(remote_info: &str) -> Result<IpAddr> {
Err(e) => Err(APIError::new(&format!("Address Parse Error \"{}\"", remote_address), Some(Box::from(e)))) Err(e) => Err(APIError::new(&format!("Address Parse Error \"{}\"", remote_address), Some(Box::from(e))))
} }
} else { } else {
Err(APIError::new(&format!("{} could not be parsed", remote_address), None))
match IpAddr::from_str(&remote_address) {
Ok(v) => Ok(v),
Err(e) => Err(APIError::new(&format!("Address Parse Error \"{}\"", remote_address), Some(Box::from(e))))
}
} }
} }

Loading…
Cancel
Save