mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 01:37:39 +03: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: https://github.com/SerenityOS/serenity/commit/acd5382924 Pull-request: https://github.com/SerenityOS/serenity/pull/17669 Reviewed-by: https://github.com/davidot Reviewed-by: https://github.com/linusg ✅
@ -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…
Reference in New Issue
Block a user