serenity/Userland/Services/RequestServer/RequestClient.ipc
Andreas Kling c9a1eebcb9 Everywhere: 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.

(cherry picked from commit e636851481eabdf00953573a5eb459ee52feeacc)

Updated various SerenityOS components to make it build.

Fetch: Make sure we iterate over HeaderMap's headers()

This fixes a build failure when built with CMake option
'-DENABLE_ALL_THE_DEBUG_MACROS=ON'.

(cherry picked from commit c51d01bea712d75f9b2cd700be942935044e49b4)
2024-06-10 12:01:57 +02:00

21 lines
878 B
Text

#include <LibHTTP/HeaderMap.h>
#include <LibURL/URL.h>
endpoint RequestClient
{
request_started(i32 request_id, IPC::File fd) =|
request_progress(i32 request_id, Optional<u64> total_size, u64 downloaded_size) =|
request_finished(i32 request_id, bool success, u64 total_size) =|
headers_became_available(i32 request_id, HTTP::HeaderMap response_headers, Optional<u32> status_code) =|
// Websocket API
// FIXME: See if this can be merged with the regular APIs
websocket_connected(i32 connection_id) =|
websocket_received(i32 connection_id, bool is_text, ByteBuffer data) =|
websocket_errored(i32 connection_id, i32 message) =|
websocket_closed(i32 connection_id, u16 code, ByteString reason, bool clean) =|
websocket_certificate_requested(i32 request_id) =|
// Certificate requests
certificate_requested(i32 request_id) =|
}