mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 07:37:03 +00:00
LibWeb: Remove OOM propagation from Fetch::Infrastructure::Methods
This commit is contained in:
parent
c79f46fe6f
commit
b3032befe0
Notes:
sideshowbarker
2024-07-16 22:26:05 +09:00
Author: https://github.com/trflynn89
Commit: b3032befe0
Pull-request: https://github.com/SerenityOS/serenity/pull/24124
4 changed files with 5 additions and 5 deletions
|
@ -36,10 +36,10 @@ bool is_forbidden_method(ReadonlyBytes method)
|
|||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-method-normalize
|
||||
ErrorOr<ByteBuffer> normalize_method(ReadonlyBytes method)
|
||||
ByteBuffer normalize_method(ReadonlyBytes method)
|
||||
{
|
||||
// To normalize a method, if it is a byte-case-insensitive match for `DELETE`, `GET`, `HEAD`, `OPTIONS`, `POST`, or `PUT`, byte-uppercase it.
|
||||
auto bytes = TRY(ByteBuffer::copy(method));
|
||||
auto bytes = MUST(ByteBuffer::copy(method));
|
||||
if (StringView { method }.is_one_of_ignoring_ascii_case("DELETE"sv, "GET"sv, "HEAD"sv, "OPTIONS"sv, "POST"sv, "PUT"sv))
|
||||
Infra::byte_uppercase(bytes);
|
||||
return bytes;
|
||||
|
|
|
@ -13,6 +13,6 @@ namespace Web::Fetch::Infrastructure {
|
|||
[[nodiscard]] bool is_method(ReadonlyBytes);
|
||||
[[nodiscard]] bool is_cors_safelisted_method(ReadonlyBytes);
|
||||
[[nodiscard]] bool is_forbidden_method(ReadonlyBytes);
|
||||
[[nodiscard]] ErrorOr<ByteBuffer> normalize_method(ReadonlyBytes);
|
||||
[[nodiscard]] ByteBuffer normalize_method(ReadonlyBytes);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue