1
0
Fork 0
mirror of https://github.com/zhaofengli/attic.git synced 2024-12-14 11:57:30 +00:00

Merge pull request #134 from srhb/trim-token-file

trim token-file contents
This commit is contained in:
Zhaofeng Li 2024-06-01 08:51:22 -06:00 committed by GitHub
commit 6603ee14ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -81,6 +81,7 @@ impl ServerTokenConfig {
match self {
ServerTokenConfig::Raw { token } => Ok(token.clone()),
ServerTokenConfig::File { token_file } => Ok(read_to_string(token_file)
.map(|t| t.trim().to_string())
.with_context(|| format!("Failed to read token from {token_file}"))?),
}
}