summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-09-11 20:18:53 -0700
committerAndreas Kling <kling@serenityos.org>2021-09-12 16:39:23 +0200
commite92b576cba3b2c481f3fb42070645d90e2566cd6 (patch)
tree1a7b14b04de374b8c025be651a090cc155cf1aec /Userland
parent54fe0c88551ef5ca42ec18dadaf7b46d530f8535 (diff)
downloadserenity-e92b576cba3b2c481f3fb42070645d90e2566cd6.zip
LibWeb: Include headers HashMap in the LoadRequest::hash() calculation
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/Loader/LoadRequest.h6
1 files 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