Skip to content
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

chore: Update busboy #1468

Merged
merged 3 commits into from May 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -67,7 +67,7 @@
"@sinonjs/fake-timers": "^9.1.2",
"@types/node": "^17.0.29",
"abort-controller": "^3.0.0",
"busboy": "^0.3.1",
"busboy": "^1.6.0",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"chai-iterator": "^3.0.2",
Expand Down
6 changes: 5 additions & 1 deletion test/client-request.js
Expand Up @@ -686,7 +686,11 @@ test('request with FormData body', { skip: nodeMajor < 16 }, (t) => {
t.same(fields[0], { key: 'key', value: 'value' })
t.ok(fileMap.has('file'))
t.equal(fileMap.get('file').data.toString(), 'Hello, world!')
t.equal(fileMap.get('file').info, 'hello_world.txt')
t.same(fileMap.get('file').info, {
filename: 'hello_world.txt',
encoding: '7bit',
mimeType: 'application/octet-stream'
})

return res.end()
})
Expand Down
4 changes: 2 additions & 2 deletions test/node-fetch/utils/server.js
@@ -1,7 +1,7 @@
const http = require('http')
const zlib = require('zlib')
const { once } = require('events')
const Busboy = require('busboy')
const newBusboy = require('busboy')

module.exports = class TestServer {
constructor () {
Expand Down Expand Up @@ -451,7 +451,7 @@ module.exports = class TestServer {
if (p === '/multipart') {
res.statusCode = 200
res.setHeader('Content-Type', 'application/json')
const busboy = new Busboy({ headers: request.headers })
const busboy = newBusboy({ headers: request.headers })
let body = ''
busboy.on('file', async (fieldName, file, fileName) => {
body += `${fieldName}=${fileName}`
Expand Down