mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibHTTP: Add a method to remove a header from a HeaderMap
This commit is contained in:
parent
d421b95fef
commit
426773e8cf
Notes:
github-actions[bot]
2025-11-02 18:04:48 +00:00
Author: https://github.com/trflynn89
Commit: 426773e8cf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6645
1 changed files with 9 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue