Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <[email protected]>
  • Loading branch information
mcollina committed Dec 18, 2024
1 parent afbb3f0 commit c68ae0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ function inject (dispatchFunc, options, callback) {
}
}

// TODO(mcollina): use standard wrapping instead
function supportStream1 (req, next) {
const payload = req._lightMyRequest.payload
if (!payload || payload._readableState || typeof payload.resume !== 'function') { // does quack like a modern stream
Expand All @@ -26,6 +25,8 @@ function supportStream1 (req, next) {
// This is a non-compliant stream
const chunks = []

// We are accumulating because Readable.wrap() does not really work as expected
// in this case.
payload.on('data', (chunk) => chunks.push(Buffer.from(chunk)))

payload.on('end', () => {
Expand Down

0 comments on commit c68ae0f

Please sign in to comment.