-
-
Notifications
You must be signed in to change notification settings - Fork 240
Change res.flush to accept a callback function argument #227
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
Conversation
6215535
to
48f195c
Compare
There was a problem hiding this 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.
function write () { | ||
chunks++ | ||
if (chunks === 20) return resp.end() | ||
if (chunks > 20) return chunks-- |
There was a problem hiding this comment.
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.
if (chunks > 20) return chunks-- | |
if (chunks > 20) { | |
chunks--; | |
return; | |
} |
Copilot uses AI. Check for mistakes.
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Since this was already reviewed in #57, I'm going to merge it and it's all good. |
Well, #57 has maintainer edits disabled, so I created this PR with @bijoythomas's changes and added tests for Brotli :)
Closes #57