From a2a2011b5ffe6c97009a0f380fae156f6a9f7730 Mon Sep 17 00:00:00 2001 From: Sarah Brofeldt Date: Wed, 15 May 2024 08:17:59 +0200 Subject: [PATCH] trim token-file contents Any ordinary file will contain at least a trailing newline which cannot be included in the bearer header. Trim all leading/trailing whitespace. --- client/src/config.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/config.rs b/client/src/config.rs index a208da9..37c3a09 100644 --- a/client/src/config.rs +++ b/client/src/config.rs @@ -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}"))?), } }