Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix initialization of brotli parameters #2658

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/workerd/api/node/zlib-util.c++
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,6 @@ bool ZlibUtil::BrotliCompressionStream<CompressionContext>::initialize(jsg::Lock
jsg::BufferSource params,
jsg::BufferSource writeResult,
jsg::Function<void()> writeCallback) {
auto results = writeResult.template asArrayPtr<uint32_t>();
this->initializeStream(kj::mv(writeResult), kj::mv(writeCallback));
auto maybeError =
this->context()->initialize(CompressionStream<CompressionContext>::AllocForBrotli,
Expand All @@ -837,6 +836,8 @@ bool ZlibUtil::BrotliCompressionStream<CompressionContext>::initialize(jsg::Lock
return false;
}

auto results = params.template asArrayPtr<uint32_t>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a test that actually fails without this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet; but I'll make sure that it's covered either from the NodeJS test suite or from a custom test in another PR.


for (int i = 0; i < results.size(); i++) {
if (results[i] == static_cast<uint32_t>(-1)) {
continue;
Expand Down
Loading