mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-06 17:11:51 +00:00
Revert "LibWeb: Mark body stream with a TypeError if the request failed"
This reverts commit 4d0301d2d2
.
This caused /html/dom/reflection-embedded.html to massively regress.
This commit is contained in:
parent
545ed08519
commit
2b7b7d4d23
Notes:
github-actions[bot]
2025-04-21 07:07:11 +00:00
Author: https://github.com/trflynn89
Commit: 2b7b7d4d23
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4413
1 changed files with 1 additions and 8 deletions
|
@ -2470,24 +2470,17 @@ WebIDL::ExceptionOr<GC::Ref<PendingResponse>> nonstandard_resource_loader_file_o
|
|||
} else {
|
||||
response->set_type(Infrastructure::Response::Type::Error);
|
||||
response->set_status(status_code.value_or(400));
|
||||
|
||||
auto [body, _] = TRY_OR_IGNORE(extract_body(realm, data));
|
||||
response->set_body(body);
|
||||
|
||||
response->set_body(move(body));
|
||||
auto body_info = response->body_info();
|
||||
body_info.encoded_size = timing_info.encoded_body_size;
|
||||
body_info.decoded_size = data.size();
|
||||
response->set_body_info(body_info);
|
||||
|
||||
for (auto const& [name, value] : response_headers.headers()) {
|
||||
auto header = Infrastructure::Header::from_latin1_pair(name, value);
|
||||
response->header_list()->append(move(header));
|
||||
}
|
||||
|
||||
// 16.1.2.2. Otherwise, if stream is readable, error stream with a TypeError.
|
||||
if (body->stream()->is_readable())
|
||||
body->stream()->error(JS::TypeError::create(realm, error));
|
||||
|
||||
if (reason_phrase.has_value())
|
||||
response->set_status_message(MUST(ByteBuffer::copy(reason_phrase.value().bytes())));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue