Skip to content

Change res.flush to accept a callback function argument#227

Merged
bjohansebas merged 4 commits intov2from
bijoythomas/master
Apr 16, 2025
Merged

Change res.flush to accept a callback function argument#227
bjohansebas merged 4 commits intov2from
bijoythomas/master

Conversation

@bjohansebas
Copy link
Copy Markdown
Member

@bjohansebas bjohansebas commented Apr 16, 2025

Well, #57 has maintainer edits disabled, so I created this PR with @bijoythomas's changes and added tests for Brotli :)

Closes #57

@bjohansebas bjohansebas requested a review from Copilot April 16, 2025 17:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread test/compression.js
function write () {
chunks++
if (chunks === 20) return resp.end()
if (chunks > 20) return chunks--
Copy link

Copilot AI Apr 16, 2025

Choose a reason for hiding this comment

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

The use of a decrement operator within the return statement to handle chunk overflow is ambiguous and may lead to unintended behavior. Consider revising the logic with an explicit conditional check to prevent writing beyond the intended chunk count.

Suggested change
if (chunks > 20) return chunks--
if (chunks > 20) {
chunks--;
return;
}

Copilot uses AI. Check for mistakes.
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedmocha@​9.2.2 ⏵ 10.8.297 +110094 +196100

View full report

@bjohansebas
Copy link
Copy Markdown
Member Author

Since this was already reviewed in #57, I'm going to merge it and it's all good.

@bjohansebas bjohansebas merged commit e2abcbf into v2 Apr 16, 2025
16 checks passed
@bjohansebas bjohansebas deleted the bijoythomas/master branch April 16, 2025 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants