diff --git a/crates/config/src/sections/matrix.rs b/crates/config/src/sections/matrix.rs index e2330a7a5..1b08c1a07 100644 --- a/crates/config/src/sections/matrix.rs +++ b/crates/config/src/sections/matrix.rs @@ -131,7 +131,11 @@ impl MatrixConfig { /// Returns an error when the shared secret could not be read from file. pub async fn secret(&self) -> anyhow::Result { Ok(match &self.secret { - Secret::File(path) => tokio::fs::read_to_string(path).await?, + Secret::File(path) => { + let raw = tokio::fs::read_to_string(path).await?; + // Trim the secret when read from file to match Synapse's behaviour + raw.trim().to_string() + } Secret::Value(secret) => secret.clone(), }) }