Skip to content

Commit

Permalink
Added missing schema case when parsing cors origin
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsanchezq committed Jul 6, 2020
1 parent b9b0b45 commit b39a91e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vit-servicing-station-lib/src/server/settings/config.rs
Expand Up @@ -129,12 +129,18 @@ impl FromStr for CorsOrigin {
return Err(std::io::Error::new(
ErrorKind::InvalidInput,
format!(
"Invalid schema {}, only http and https are supported: ",
"Cors origin invalid schema {}, only [http] and [https] are supported: ",
uri.scheme_str().unwrap()
),
));
}
} else {
return Err(std::io::Error::new(
ErrorKind::InvalidInput,
"Cors origin missing schema, only [http] or [https] are supported",
));
}

if let Some(p) = uri.path_and_query() {
if p.as_str() != "/" {
return Err(std::io::Error::new(
Expand Down

0 comments on commit b39a91e

Please sign in to comment.