1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:37:43 +00:00

LibWeb: Include headers HashMap in the LoadRequest::hash() calculation

This commit is contained in:
Brian Gianforcaro 2021-09-11 20:18:53 -07:00 committed by Andreas Kling
parent 54fe0c8855
commit e92b576cba

View file

@ -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