header remove fix

This commit is contained in:
MeexReay 2025-01-26 01:23:49 +03:00
parent 3726a28286
commit 58cfd1ab60

View File

@ -74,9 +74,11 @@ impl Headers {
} }
pub fn remove(&mut self, key: impl ToString) { pub fn remove(&mut self, key: impl ToString) {
let mut c = 0;
for (i, t) in self.entries.clone().iter().enumerate() { for (i, t) in self.entries.clone().iter().enumerate() {
if t.0.to_lowercase() == key.to_string().to_lowercase() { if t.0.to_lowercase() == key.to_string().to_lowercase() {
self.entries.remove(i); self.entries.remove(i-c);
c += 1
} }
} }
} }