LibWeb: Support ReadonlyBytes as argument for extract_body()

This now matches the spec's requirement of "a byte sequence or BodyInit
object object".
This commit is contained in:
Linus Groh 2022-09-25 19:15:35 +01:00
commit b5e8e9b30b
Notes: sideshowbarker 2024-07-17 06:39:26 +09:00
2 changed files with 8 additions and 2 deletions

View file

@ -19,6 +19,7 @@ using XMLHttpRequestBodyInit = Variant<JS::Handle<FileAPI::Blob>, JS::Handle<JS:
// https://fetch.spec.whatwg.org/#bodyinit
using BodyInit = Variant<JS::Handle<Streams::ReadableStream>, JS::Handle<FileAPI::Blob>, JS::Handle<JS::Object>, JS::Handle<URL::URLSearchParams>, String>;
WebIDL::ExceptionOr<Infrastructure::BodyWithType> extract_body(JS::Realm&, BodyInit const&, bool keepalive = false);
using BodyInitOrReadbleBytes = Variant<JS::Handle<Streams::ReadableStream>, JS::Handle<FileAPI::Blob>, JS::Handle<JS::Object>, JS::Handle<URL::URLSearchParams>, String, ReadonlyBytes>;
WebIDL::ExceptionOr<Infrastructure::BodyWithType> extract_body(JS::Realm&, BodyInitOrReadbleBytes const&, bool keepalive = false);
}