tsk-22: Add function to parse env variable to a vector of strings #25
@@ -90,7 +90,10 @@ pub async fn get_allowed_origins() -> crate::EnvVar {
|
||||
let key = crate::keys::ALLOWED_ORIGINS;
|
||||
let value = std::env::var(key).expect(key);
|
||||
|
||||
crate::init_envvar(key, &value)
|
||||
let mut envvar = crate::init_envvar(key, &value);
|
||||
crate::init_delimiter(&mut envvar, ',');
|
||||
|
||||
envvar
|
||||
}
|
||||
|
||||
/// Get environment not specified in the code
|
||||
|
@@ -114,7 +114,9 @@ mod tests {
|
||||
"{} does not match {:?}",
|
||||
icarus_envy::keys::ALLOWED_ORIGINS,
|
||||
result
|
||||
)
|
||||
);
|
||||
|
||||
assert_eq!(result.has_delimiter, true, "The {} variable has an issue finding the delimiter", result.key)
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Reference in New Issue
Block a user