mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibCore: Add support for ReadonlyBytes to MemoryStream
This commit is contained in:
parent
38a882ddfa
commit
d402f6cdb3
4 changed files with 22 additions and 6 deletions
|
@ -78,8 +78,7 @@ static Optional<ByteBuffer> handle_content_encoding(ByteBuffer const& buf, Strin
|
|||
} else if (content_encoding == "br") {
|
||||
dbgln_if(JOB_DEBUG, "Job::handle_content_encoding: buf is brotli compressed!");
|
||||
|
||||
// FIXME: MemoryStream is both read and write, however we only need the read part here
|
||||
auto bufstream_result = Core::Stream::MemoryStream::construct({ const_cast<u8*>(buf.data()), buf.size() });
|
||||
auto bufstream_result = Core::Stream::MemoryStream::construct({ buf.data(), buf.size() });
|
||||
if (bufstream_result.is_error()) {
|
||||
dbgln("Job::handle_content_encoding: MemoryStream::construct() failed.");
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue