mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Make LoadRequest
headers case insensitive
This commit is contained in:
parent
9b61579aa6
commit
1167fdb17a
Notes:
sideshowbarker
2024-07-17 07:35:03 +09:00
Author: https://github.com/leeight Commit: https://github.com/SerenityOS/serenity/commit/1167fdb17a Pull-request: https://github.com/SerenityOS/serenity/pull/15572 Reviewed-by: https://github.com/linusg
2 changed files with 3 additions and 4 deletions
|
@ -229,7 +229,6 @@ bool FrameLoader::load(LoadRequest& request, Type type)
|
|||
// -> "frame"
|
||||
// -> "iframe"
|
||||
// `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
|
||||
// FIXME: This should be case-insensitive.
|
||||
if (!request.headers().contains("Accept"))
|
||||
request.set_header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
{
|
||||
if (m_headers.size() != other.m_headers.size())
|
||||
return false;
|
||||
for (auto& it : m_headers) {
|
||||
for (auto const& it : m_headers) {
|
||||
auto jt = other.m_headers.find(it.key);
|
||||
if (jt == other.m_headers.end())
|
||||
return false;
|
||||
|
@ -66,12 +66,12 @@ public:
|
|||
void set_header(String const& name, String const& value) { m_headers.set(name, value); }
|
||||
String header(String const& name) const { return m_headers.get(name).value_or({}); }
|
||||
|
||||
HashMap<String, String> const& headers() const { return m_headers; }
|
||||
HashMap<String, String, CaseInsensitiveStringTraits> const& headers() const { return m_headers; }
|
||||
|
||||
private:
|
||||
AK::URL m_url;
|
||||
String m_method { "GET" };
|
||||
HashMap<String, String> m_headers;
|
||||
HashMap<String, String, CaseInsensitiveStringTraits> m_headers;
|
||||
ByteBuffer m_body;
|
||||
Core::ElapsedTimer m_load_timer;
|
||||
Optional<Page&> m_page;
|
||||
|
|
Loading…
Reference in a new issue