LibWeb: Don't use ByteBuffer::wrap() when loading about: URLs

Let's just copy an empty string here to make ourselves a ByteBuffer.
This commit is contained in:
Andreas Kling 2020-12-19 17:39:59 +01:00
parent 48d74c5356
commit 497f1fd472
Notes: sideshowbarker 2024-07-19 00:44:26 +09:00

View file

@ -118,7 +118,7 @@ void ResourceLoader::load(const LoadRequest& request, Function<void(const ByteBu
if (url.protocol() == "about") {
dbg() << "Loading about: URL " << url;
deferred_invoke([success_callback = move(success_callback)](auto&) {
success_callback(ByteBuffer::wrap(const_cast<char*>(String::empty().characters()), 1), {});
success_callback(String::empty().to_byte_buffer(), {});
});
return;
}