Skip to content

Commit

Permalink
chore: Update busboy (nodejs#1468)
Browse files Browse the repository at this point in the history
  • Loading branch information
kibertoad authored and metcoder95 committed Dec 26, 2022
1 parent 6098dba commit a045105
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
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

0 comments on commit a045105

Please sign in to comment.