diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp index 19656b61508..bc80ce01127 100644 --- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp @@ -437,4 +437,15 @@ StringView request_mode_to_string(Request::Mode mode) VERIFY_NOT_REACHED(); } +Optional request_priority_from_string(StringView string) +{ + if (string.equals_ignoring_ascii_case("high"sv)) + return Request::Priority::High; + if (string.equals_ignoring_ascii_case("low"sv)) + return Request::Priority::Low; + if (string.equals_ignoring_ascii_case("auto"sv)) + return Request::Priority::Auto; + return {}; +} + } diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h index 9b49898664a..f002ce2b0ca 100644 --- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h +++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h @@ -532,4 +532,6 @@ private: StringView request_destination_to_string(Request::Destination); StringView request_mode_to_string(Request::Mode); +Optional request_priority_from_string(StringView); + }