mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 01:59:31 +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
Notes:
sideshowbarker
2024-07-17 17:40:13 +09:00
Author: https://github.com/Lubrsi
Commit: acd5382924
Pull-request: https://github.com/SerenityOS/serenity/pull/17669
Reviewed-by: https://github.com/davidot
Reviewed-by: https://github.com/linusg ✅
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