Skip to content

fix #123 - move res.send() outside streaming loop#124

Open
SUVAJIT-KARMAKAR wants to merge 2 commits intobetter-auth:mainfrom
SUVAJIT-KARMAKAR:fix/set-response-streaming-truncation
Open

fix #123 - move res.send() outside streaming loop#124
SUVAJIT-KARMAKAR wants to merge 2 commits intobetter-auth:mainfrom
SUVAJIT-KARMAKAR:fix/set-response-streaming-truncation

Conversation

@SUVAJIT-KARMAKAR
Copy link
Copy Markdown

@SUVAJIT-KARMAKAR SUVAJIT-KARMAKAR commented Apr 3, 2026

SUMMARY

  • Fixes a bug in setResponse where res.end() was incorrectly invoked inside the for loop within the next() helper.
    This caused streamed responses to terminate prematurely after the first 16KB chunk.

  • Moves res.end() outside the loop, ensuring the response is finalized only after all chunks are fully consumed from the reader.


closes #123

@SUVAJIT-KARMAKAR SUVAJIT-KARMAKAR changed the title fix: move res.send() outside streaming loop fix #123: move res.send() outside streaming loop Apr 3, 2026
@SUVAJIT-KARMAKAR SUVAJIT-KARMAKAR changed the title fix #123: move res.send() outside streaming loop fix #123 - move res.send() outside streaming loop Apr 3, 2026
@bytaesu
Copy link
Copy Markdown
Member

bytaesu commented Apr 3, 2026

Hi @SUVAJIT-KARMAKAR, thanks for working on this!

could you add a regression test case?

@SUVAJIT-KARMAKAR
Copy link
Copy Markdown
Author

Hi @SUVAJIT-KARMAKAR, thanks for working on this!

could you add a regression test case?

Sure, working on it @bytaesu

@SUVAJIT-KARMAKAR
Copy link
Copy Markdown
Author

Hey @bytaesu, added the required test case for the fix. Kindly have a look. Thanks

@SUVAJIT-KARMAKAR
Copy link
Copy Markdown
Author

Hi @bytaesu, any update on this fix ?

@SUVAJIT-KARMAKAR
Copy link
Copy Markdown
Author

Hey, @bytaesu any direction ?

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.

2 participants