LibHTTP+RequestServer: Add HTTP::HeaderMap and use for response headers

Instead of using a HashMap<ByteString, ByteString, CaseInsensitive...>
everywhere, we now encapsulate this in a class.

Even better, the new class also allows keeping track of multiple headers
with the same name! This will make it possible for HTTP responses to
actually retain all their headers on the perilous journey from
RequestServer to LibWeb.
This commit is contained in:
Andreas Kling 2024-06-09 11:28:37 +02:00 committed by Andreas Kling
commit e636851481
Notes: sideshowbarker 2024-07-17 06:33:00 +09:00
21 changed files with 159 additions and 53 deletions

View file

@ -9,7 +9,7 @@
namespace HTTP {
HttpResponse::HttpResponse(int code, HashMap<ByteString, ByteString, CaseInsensitiveStringTraits>&& headers, size_t size)
HttpResponse::HttpResponse(int code, HeaderMap&& headers, size_t size)
: m_code(code)
, m_headers(move(headers))
, m_downloaded_size(size)