LibHTTP: Add a method to remove a header from a HeaderMap

This commit is contained in:
Timothy Flynn 2025-10-30 07:01:35 -04:00 committed by Tim Flynn
parent d421b95fef
commit 426773e8cf
Notes: github-actions[bot] 2025-11-02 18:04:48 +00:00

View file

@ -34,6 +34,15 @@ public:
m_headers.append({ move(name), move(value) });
}
void remove(StringView name)
{
if (m_map.remove(name)) {
m_headers.remove_all_matching([&](Header const& header) {
return header.name.equals_ignoring_ascii_case(name);
});
}
}
[[nodiscard]] bool contains(ByteString const& name) const
{
return m_map.contains(name);