From e92b576cba3b2c481f3fb42070645d90e2566cd6 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sat, 11 Sep 2021 20:18:53 -0700 Subject: [PATCH] LibWeb: Include headers HashMap in the LoadRequest::hash() calculation --- Userland/Libraries/LibWeb/Loader/LoadRequest.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Loader/LoadRequest.h b/Userland/Libraries/LibWeb/Loader/LoadRequest.h index 7c4076f209..5481fdbabe 100644 --- a/Userland/Libraries/LibWeb/Loader/LoadRequest.h +++ b/Userland/Libraries/LibWeb/Loader/LoadRequest.h @@ -34,8 +34,10 @@ public: unsigned hash() const { - // FIXME: Include headers in the hash as well - return pair_int_hash(pair_int_hash(m_url.to_string().hash(), m_method.hash()), string_hash((const char*)m_body.data(), m_body.size())); + auto body_hash = string_hash((const char*)m_body.data(), m_body.size()); + auto body_and_headers_hash = pair_int_hash(body_hash, m_headers.hash()); + auto url_and_method_hash = pair_int_hash(m_url.to_string().hash(), m_method.hash()); + return pair_int_hash(body_and_headers_hash, url_and_method_hash); } bool operator==(const LoadRequest& other) const