mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
LibWeb: Make about:blank load correctly
- Don't treat an empty `about:blank` resource as an error. - Give `about:` urls a content-type so `FrameLoader::parse_document()` won't reject them.
This commit is contained in:
parent
61a9ad45ed
commit
1f82beded3
Notes:
sideshowbarker
2024-07-17 10:55:11 +09:00
Author: https://github.com/AtkinsSJ
Commit: 1f82beded3
Pull-request: https://github.com/SerenityOS/serenity/pull/14020
Reviewed-by: https://github.com/kennethmyhra ✅
Reviewed-by: https://github.com/linusg
2 changed files with 7 additions and 3 deletions
|
@ -150,8 +150,12 @@ void ResourceLoader::load(LoadRequest& request, Function<void(ReadonlyBytes, Has
|
|||
if (url.protocol() == "about") {
|
||||
dbgln_if(SPAM_DEBUG, "Loading about: URL {}", url);
|
||||
log_success(request);
|
||||
deferred_invoke([success_callback = move(success_callback)] {
|
||||
success_callback(String::empty().to_byte_buffer(), {}, {});
|
||||
|
||||
HashMap<String, String, CaseInsensitiveStringTraits> response_headers;
|
||||
response_headers.set("Content-Type", "text/html; charset=UTF-8");
|
||||
|
||||
deferred_invoke([success_callback = move(success_callback), response_headers = move(response_headers)] {
|
||||
success_callback(String::empty().to_byte_buffer(), response_headers, {});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue