diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp index c8a7c239366..c52ac6bad52 100644 --- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp @@ -418,4 +418,21 @@ StringView request_destination_to_string(Request::Destination destination) VERIFY_NOT_REACHED(); } +StringView request_mode_to_string(Request::Mode mode) +{ + switch (mode) { + case Request::Mode::SameOrigin: + return "same-origin"sv; + case Request::Mode::CORS: + return "cors"sv; + case Request::Mode::NoCORS: + return "no-cors"sv; + case Request::Mode::Navigate: + return "navigate"sv; + case Request::Mode::WebSocket: + return "websocket"sv; + } + VERIFY_NOT_REACHED(); +} + } diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h index 08dcca2ff77..d1d25b2ec0d 100644 --- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h +++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h @@ -518,5 +518,6 @@ private: }; StringView request_destination_to_string(Request::Destination); +StringView request_mode_to_string(Request::Mode); }