diff options
Diffstat (limited to 'pingora-http')
-rw-r--r-- | pingora-http/src/lib.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pingora-http/src/lib.rs b/pingora-http/src/lib.rs index 74dee53..71f81ee 100644 --- a/pingora-http/src/lib.rs +++ b/pingora-http/src/lib.rs @@ -573,10 +573,13 @@ fn remove_header<'a, T, N: ?Sized>( where &'a N: 'a + AsHeaderName, { - if let Some(name_map) = name_map { - name_map.remove(name); + let removed = value_map.remove(name); + if removed.is_some() { + if let Some(name_map) = name_map { + name_map.remove(name); + } } - value_map.remove(name) + removed } #[inline] |