From ae786eabec3edb261156400b5d9881cc47146f20 Mon Sep 17 00:00:00 2001 From: epi Date: Wed, 17 Apr 2024 21:05:07 -0400 Subject: [PATCH] fixed issue with multiple leading spaces --- src/config/container.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/config/container.rs b/src/config/container.rs index 1d9324d6..06ddf598 100644 --- a/src/config/container.rs +++ b/src/config/container.rs @@ -940,7 +940,15 @@ impl Configuration { // all other items in the iterator returned by split, when combined with the // original split deliminator (:), make up the header's final value let value = split_val.collect::>().join(":"); - config.headers.insert(name.to_string(), value.to_string()); + + if value.starts_with(' ') && !value.starts_with(" ") { + // first character is a space and the second character isn't + // we can trim the leading space + let trimmed = value.trim_start(); + config.headers.insert(name.to_string(), trimmed.to_string()); + } else { + config.headers.insert(name.to_string(), value.to_string()); + } } }