fix room ID messages, remove comments

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-01-24 21:09:07 -05:00 committed by June
parent 08a183e8c7
commit 0e8267656f
3 changed files with 2 additions and 8 deletions

View file

@ -76,8 +76,7 @@ pub async fn create_room_route(
if custom_room_id_s.contains(':') { if custom_room_id_s.contains(':') {
return Err(Error::BadRequest( return Err(Error::BadRequest(
ErrorKind::InvalidParam, ErrorKind::InvalidParam,
"Custom room ID contained `:` which is not allowed. "Custom room ID contained `:` which is not allowed. Please note that this expects a localpart, not the full room ID.",
Please note that this expects a localpart, not the full room ID.",
)); ));
} else if custom_room_id_s.contains(char::is_whitespace) { } else if custom_room_id_s.contains(char::is_whitespace) {
return Err(Error::BadRequest( return Err(Error::BadRequest(
@ -144,8 +143,7 @@ pub async fn create_room_route(
if localpart.contains(':') { if localpart.contains(':') {
return Err(Error::BadRequest( return Err(Error::BadRequest(
ErrorKind::InvalidParam, ErrorKind::InvalidParam,
"Room alias contained `:` which is not allowed. "Room alias contained `:` which is not allowed. Please note that this expects a localpart, not the full room alias.",
Please note that this expects a localpart, not the full room alias.",
)); ));
} else if localpart.contains(char::is_whitespace) { } else if localpart.contains(char::is_whitespace) {
return Err(Error::BadRequest( return Err(Error::BadRequest(

View file

@ -132,8 +132,6 @@ where
)); ));
} }
// rust's built in <Ipv4Addr> parsing does not consider things like octal addresses valid
// so we should check both just to be safe.
if destination.is_ip_literal() || IPAddress::is_valid(destination.host()) { if destination.is_ip_literal() || IPAddress::is_valid(destination.host()) {
info!( info!(
"Destination {} is an IP literal, checking against IP range denylist.", "Destination {} is an IP literal, checking against IP range denylist.",

View file

@ -717,8 +717,6 @@ impl Service {
where where
T: Debug, T: Debug,
{ {
// rust's built in <Ipv4Addr> parsing does not consider things like octal addresses valid
// so we should check both just to be safe.
if destination.is_ip_literal() || IPAddress::is_valid(destination.host()) { if destination.is_ip_literal() || IPAddress::is_valid(destination.host()) {
info!( info!(
"Destination {} is an IP literal, checking against IP range denylist.", "Destination {} is an IP literal, checking against IP range denylist.",