Strip newline from jwt secrets (#3132)

## Issue Addressed

Resolves #3128 

## Proposed Changes

Strip trailing newlines from jwt secret files.
This commit is contained in:
Pawan Dhananjay 2022-04-01 00:59:00 +00:00
parent 41e7a07c51
commit 9ec072ff3b

View File

@ -187,7 +187,7 @@ impl ExecutionLayer {
}) })
.and_then(|ref s| { .and_then(|ref s| {
let secret = JwtKey::from_slice( let secret = JwtKey::from_slice(
&hex::decode(strip_prefix(s)) &hex::decode(strip_prefix(s.trim_end()))
.map_err(|e| format!("Invalid hex string: {:?}", e))?, .map_err(|e| format!("Invalid hex string: {:?}", e))?,
)?; )?;
Ok((secret, p.to_path_buf())) Ok((secret, p.to_path_buf()))