mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
LibWeb/Fetch: Set length synchronously in extract_body
Since we don't currently have streams, we didn't set length anywhere. However, this is required by XHR's reliance on Fetch to get the total number of bytes for the progress events.
This commit is contained in:
parent
e557602d34
commit
acd5382924
1 changed files with 4 additions and 0 deletions
|
@ -117,6 +117,10 @@ WebIDL::ExceptionOr<Infrastructure::BodyWithType> extract_body(JS::Realm& realm,
|
|||
}));
|
||||
|
||||
// FIXME: 11. If source is a byte sequence, then set action to a step that returns source and length to source’s length.
|
||||
// For now, do it synchronously.
|
||||
if (source.has<ByteBuffer>())
|
||||
length = source.get<ByteBuffer>().size();
|
||||
|
||||
// FIXME: 12. If action is non-null, then run these steps in parallel:
|
||||
|
||||
// 13. Let body be a body whose stream is stream, source is source, and length is length.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue