Apply fix(stream): Allows body larger than 16 KiB with middleware

parent f3fc9126
...@@ -90,8 +90,14 @@ export function getClonableBody<T extends IncomingMessage>( ...@@ -90,8 +90,14 @@ export function getClonableBody<T extends IncomingMessage>(
const input = buffered ?? readable const input = buffered ?? readable
const p1 = new PassThrough() const p1 = new PassThrough()
const p2 = new PassThrough() const p2 = new PassThrough()
input.pipe(p1) input.on('data', (chunk) => {
input.pipe(p2) p1.push(chunk)
p2.push(chunk)
})
input.on('end', () => {
p1.push(null)
p2.push(null)
})
buffered = p2 buffered = p2
return p1 return p1
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment