mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 20:17:13 +02:00
LibWeb/Fetch: Add to_string function for Request::Mode
This commit is contained in:
committed by
Andreas Kling
parent
3daba8970c
commit
6e3b2ce300
Notes:
sideshowbarker
2024-07-18 04:38:32 +09:00
Author: https://github.com/jamierocks Commit: https://github.com/SerenityOS/serenity/commit/6e3b2ce300 Pull-request: https://github.com/SerenityOS/serenity/pull/24164 Reviewed-by: https://github.com/kennethmyhra ✅
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user