Skip to content

Commit 426773e

Browse files
committed
LibHTTP: Add a method to remove a header from a HeaderMap
1 parent d421b95 commit 426773e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Libraries/LibHTTP/HeaderMap.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ class HeaderMap {
3434
m_headers.append({ move(name), move(value) });
3535
}
3636

37+
void remove(StringView name)
38+
{
39+
if (m_map.remove(name)) {
40+
m_headers.remove_all_matching([&](Header const& header) {
41+
return header.name.equals_ignoring_ascii_case(name);
42+
});
43+
}
44+
}
45+
3746
[[nodiscard]] bool contains(ByteString const& name) const
3847
{
3948
return m_map.contains(name);

0 commit comments

Comments
 (0)