-
-
Notifications
You must be signed in to change notification settings - Fork 25
Fails to parse request stream on bun #139
Copy link
Copy link
Closed as not planned
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
2.1.0
Plugin version
No response
Node.js version
Bun v1.0.15
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
14.0
Description
This is related to
- await req.file returns undefined fastify-multipart#498
- Get uploaded file using @fastify/multipart not working oven-sh/bun#5265
I understand if bun support is beyond the scope of this project, but I did do some exploring. From what I can tell the root issue is in this library (or bun!).
What I did was wrote the failing request stream to a file. Then in the root of this project I stream that file into busboy and listen for fields and files. When running with node the file and field are found. When running with bun neither events are emitted.
At the root
'use strict'
const fs = require('fs')
const Busboy = require('.')
const busboy = new Busboy({
headers: {
'content-type': 'multipart/form-data; boundary=__X_PAW_BOUNDARY__'
}
})
busboy.on('field', function (key) {
console.log('field found', key)
})
busboy.on('file', function (fieldname, stream) {
console.log('file found', fieldname)
stream.on('end', () => {
console.log(`File [${fieldname}] Finished`)
})
})
busboy.on('finish', function () {
console.log('finished')
})
// stream request dump to busboy
const readable = fs.createReadStream('./test/dump')
readable.pipe(busboy)The request dump: https://drive.google.com/file/d/19_y4fy5pwi6_xDYblHhSp0bEIMhNSiYS/view?usp=share_link
node busboy-test.js
bun busboy-test.jsSteps to Reproduce
Run the above script
Expected Behavior
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels