mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibWeb/XHR: Ensure type set on blob responses
This commit is contained in:
parent
31a69ce887
commit
be3e221b3f
Notes:
github-actions[bot]
2025-02-16 19:09:45 +00:00
Author: https://github.com/davidmhewitt 🔰
Commit: be3e221b3f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3559
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/tcl3 ✅
4 changed files with 533 additions and 2 deletions
|
@ -217,8 +217,7 @@ WebIDL::ExceptionOr<JS::Value> XMLHttpRequest::response()
|
|||
// 6. Otherwise, if this’s response type is "blob", set this’s response object to a new Blob object representing this’s received bytes with type set to the result of get a final MIME type for this.
|
||||
else if (m_response_type == Bindings::XMLHttpRequestResponseType::Blob) {
|
||||
auto mime_type_as_string = get_final_mime_type().serialized();
|
||||
auto blob_part = FileAPI::Blob::create(realm(), m_received_bytes, move(mime_type_as_string));
|
||||
auto blob = FileAPI::Blob::create(realm(), Vector<FileAPI::BlobPart> { GC::make_root(*blob_part) });
|
||||
auto blob = FileAPI::Blob::create(realm(), m_received_bytes, move(mime_type_as_string));
|
||||
m_response_object = GC::Ref<JS::Object> { blob };
|
||||
}
|
||||
// 7. Otherwise, if this’s response type is "document", set a document response for this.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue