mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-01 13:49:05 +00:00
LibWeb/Fetch: Add to_string function for Request::Mode
This commit is contained in:
parent
3daba8970c
commit
6e3b2ce300
Notes:
sideshowbarker
2024-07-18 04:38:32 +09:00
Author: https://github.com/jamierocks
Commit: 6e3b2ce300
Pull-request: https://github.com/SerenityOS/serenity/pull/24164
Reviewed-by: https://github.com/kennethmyhra ✅
2 changed files with 18 additions and 0 deletions
|
@ -418,4 +418,21 @@ StringView request_destination_to_string(Request::Destination destination)
|
||||||
VERIFY_NOT_REACHED();
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -518,5 +518,6 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
StringView request_destination_to_string(Request::Destination);
|
StringView request_destination_to_string(Request::Destination);
|
||||||
|
StringView request_mode_to_string(Request::Mode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue