mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Make CSS font loader tolerate WPT web server shenanigans
The web server for WPT has a tendency to just disconnect after sending us a resource. This makes curl think an error occurred, but it's actually still recoverable and we have the data. So instead of just bailing, do what we already do for other kinds of resources and try to parse the data we got. If it works out, great! It would be nice to solve this in the networking layer instead, but I'll leave that as an exercise for our future selves.
This commit is contained in:
parent
2303142386
commit
32299e74cb
Notes:
github-actions[bot]
2024-09-21 17:21:21 +00:00
Author: https://github.com/awesomekling
Commit: 32299e74cb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1473
5 changed files with 32 additions and 16 deletions
|
@ -120,9 +120,11 @@ void Resource::did_load(Badge<ResourceLoader>, ReadonlyBytes data, HTTP::HeaderM
|
|||
});
|
||||
}
|
||||
|
||||
void Resource::did_fail(Badge<ResourceLoader>, ByteString const& error, Optional<u32> status_code)
|
||||
void Resource::did_fail(Badge<ResourceLoader>, ByteString const& error, ReadonlyBytes data, HTTP::HeaderMap const& headers, Optional<u32> status_code)
|
||||
{
|
||||
m_error = error;
|
||||
m_encoded_data = ByteBuffer::copy(data).release_value_but_fixme_should_propagate_errors();
|
||||
m_response_headers = headers;
|
||||
m_status_code = move(status_code);
|
||||
m_state = State::Failed;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue